Oracle VB Problems

I have a VB 6 application to connect to a Oracle database using ADO Connection. It works fine with Access. But when I try with my Oracle Database it does not retrieve any data. It can only show the Structure of the Tables. But no. of Rows is always 0. I have used Datagrid but only column names are displayed. Please help me. Its urgent for my exam also I m New to VB. The Connection Codes are given Below.

Option Explicit
Public conn As ADODB.Connection
Public rsUserAccount As ADODB.Recordset

Public Sub Connection()

'The Purpose of this function is to open a connection to link the database

Set conn = New ADODB.Connection

'conn.ConnectionString = "USER ID=scott;PASSWORD=tiger"
'conn.Provider = "MSDAORA.1"

conn.ConnectionString = "UID=scott;PWD=tiger;DRIVER={Microsoft ODBC for Oracle};" _
& "SERVER=Ora9iDBS;"


End Sub

Public Sub User_Account()

'The Purpose of this function is to open the recordset "User_Account"

Set rsUserAccount = New ADODB.Recordset

With rsUserAccount
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.ActiveConnection = conn
.Source = "Select * from UserAccount"
.CursorLocation = adUseClient
End With

End Sub

Thanks in advance. bye
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!