zoltix
asked on
How do I retrieve data using a ODBC connection ?
I believe that my connection it s ok.
I try retrieve information from database but there is a error (ODBC called error).
parameter :
DSN=VTM,UID=VTM;PW:VTM
Dim wrkODBC As Workspace
Dim conBO As DAO.Connection
Dim dbNumeros As DataBase
Set wrkODBC = CreateWorkspace ("VTM_Con", "VTM_Con", "", dbUseODBC)
'It s Ok
Set conBO = wrkODBC.OpenConnection
("VTM",
dbDriverPrompt, , "ODBC;UID=VTM;PWD=VTM;DSN= VTM")
'It s Ok
MsgBox conBO.Connect
MsgBox conBO.Name
With wrkODBC
' Enumerate Properties collection of ODBCDirect
' workspace.
Debug.Print "Properties of " & .Name
On Error Resume Next
For Each prpLoop In .Properties
Debug.Print " " & prpLoop.Name & " = " & prpLoop
MsgBox (" " & prpLoop.Name & " = " & prpLoop)
Next prpLoop
On Error GoTo 0
End With
Set rstTemp = conBO.OpenRecordset("selec t * from oas_company")
'ODBC called Error !!!!! ?????
With rstTemp
Do While .EOF
MsgBox !CODE
.MoveNext
Loop
.Close
End With
Thank
I try retrieve information from database but there is a error (ODBC called error).
parameter :
DSN=VTM,UID=VTM;PW:VTM
Dim wrkODBC As Workspace
Dim conBO As DAO.Connection
Dim dbNumeros As DataBase
Set wrkODBC = CreateWorkspace ("VTM_Con", "VTM_Con", "", dbUseODBC)
'It s Ok
Set conBO = wrkODBC.OpenConnection
("VTM",
dbDriverPrompt, , "ODBC;UID=VTM;PWD=VTM;DSN=
'It s Ok
MsgBox conBO.Connect
MsgBox conBO.Name
With wrkODBC
' Enumerate Properties collection of ODBCDirect
' workspace.
Debug.Print "Properties of " & .Name
On Error Resume Next
For Each prpLoop In .Properties
Debug.Print " " & prpLoop.Name & " = " & prpLoop
MsgBox (" " & prpLoop.Name & " = " & prpLoop)
Next prpLoop
On Error GoTo 0
End With
Set rstTemp = conBO.OpenRecordset("selec
'ODBC called Error !!!!! ?????
With rstTemp
Do While .EOF
MsgBox !CODE
.MoveNext
Loop
.Close
End With
Thank
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just by having a quick look and excuse me if I am completley wrong but where you have
do while .eof
Shouldn't you have:
do while not .EOF
Cheers
James