Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong Type Arguments

Status
Not open for further replies.

robinsql

Programmer
Aug 2, 2002
236
IE
Hi,
When I run the code beneath which is in a DLL, the last line gives me the following error message...

"Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another"

Dim oRs As Recordset
Set oRs = New Recordset
Dim strSQL As String

strSQL = "Select * from tblDeliveries Where Job ='" & strJobNo & "'"
oRs.Open strSQL ', oConn, adOpenKeyset, adLockOptimistic

Can anyone explain to me what the reason for this is?

Any help gratefully reeived,
Thanks,
Robin
 
1. There seems to be a spare single quote here:
strSQL ', oConn

2. You have strJobNo between single quotes, which is correct if Job field in db is a string. Doesn't want the quotes if it's a numeric type

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Hi,
Thanks for quick reply.
Sorry. That line should actually read the following...

oRs.Open strSQL, oConn, adOpenKeyset, adLockOptimistic

If I use the following, it works...
Set oRS = oConn.Execute(strSQL)

However, this code is somebody else's and they say it should work, as it is live on a site and working. Apparently!

Any ideas?
 
The oRs.Open is specifically a ADOCE command - this is CE we're talking about?

Set oRS = oConn.Execute(strSQL) would be normal for straight VB

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
I've never used ADOCE. As far as I know this is just VB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top