When you say it fails, what OLE-DB Error message do you get?
The following is a revised version of your code:
oConnection = CreateObject("ADODB.Connection")
oCommand = CreateObject("ADODB.Command")
With oConnection
.CursorLocation = 3 && Client-Side Cursor
.ConnectionString = "DATABASE=PROGLIB;DSN=DDHELP;UID=someone;PWD=;"
.Open
EndWith
With oCommand
.CommandText = "Select * from programs where rtrim(ltrim(progrm_key)) = ?"
oparameter = .CreateParameter("v_progkey",129,1,1,"1")
.Parameters.Append(oParameter)
.CommandType = 1
.ActiveConnection = oConnection
oRecordSet = .Execute
EndWith
?oRecordset.Fields.Count
For Each Field in oRecordset.Fields
?Field.Name,Field.Value
Next Field
For starters, if you are using SQL Server, I would HIGHLY recommend using the OLE-DB Provider, NOT the OLE-DB Provider for ODBC.
Things to verify:
1. The number of fields in the Recordset
2. The names of the fields in the Recordset
Good luck,
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only