|
-
Jan 3rd, 2011, 01:16 PM
#1
Thread Starter
New Member
Run-Time Error 3001 - Help with VB/SQL Code
Hello everyone,
I am using VB6.
Here is a snippet of code (I haven't posted database connection info), which receives an Error 3001 "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another"
You'll notice that in my SQL statement I'm retrieving a value from a VB textbox, I suspect this may be the culprit...anyone see something obvious?
Private Sub Command1_Click()
Dim strSQL As String
Dim oconn As New ADODB.Connection
Dim rs As New ADODB.Recordset
'SQL Code / Query
strSQL = "SELECT DISTINCT OP_ORDER_HEADERS.DATE_CREATED, OP_ORDER_HEADERS.CALLBACK_NUMBER, OP_ORDER_HEADERS.ORDER_STATUS, OP_ORDER_HEADERS.DELIVERY_ADDRESS, OP_ORDER_HEADERS.ORDER_TYPE, OP_ORDER_HEADERS.CALLBACK_COMMENTS " & _
"FROM OPD_OWNER.OP_ORDER_HEADERS OP_ORDER_HEADERS WHERE (OP_ORDER_HEADERS.DELIVERY_ADDRESS Like '%" & Addy.Text & "%' ) " & _
"ORDER BY OP_ORDER_HEADERS.DATE_CREATED DESC "
Any help here would be appreciated.
-
Jan 3rd, 2011, 01:25 PM
#2
Thread Starter
New Member
Re: Run-Time Error 3001 - Help with VB/SQL Code
Code:
Private Sub Command1_Click()
Dim strSQL As String
Dim oconn As New ADODB.Connection
Dim rs As New ADODB.Recordset
'SQL Code / Query
strSQL = "SELECT DISTINCT OP_ORDER_HEADERS.DATE_CREATED, OP_ORDER_HEADERS.CALLBACK_NUMBER, OP_ORDER_HEADERS.ORDER_STATUS, OP_ORDER_HEADERS.DELIVERY_ADDRESS, OP_ORDER_HEADERS.ORDER_TYPE, OP_ORDER_HEADERS.CALLBACK_COMMENTS " & _
"FROM OPD_OWNER.OP_ORDER_HEADERS OP_ORDER_HEADERS WHERE (OP_ORDER_HEADERS.DELIVERY_ADDRESS Like '%" & Addy.Text & "%' ) " & _
"ORDER BY OP_ORDER_HEADERS.DATE_CREATED DESC "
-
Jan 3rd, 2011, 01:47 PM
#3
Thread Starter
New Member
Re: Run-Time Error 3001 - Help with VB/SQL Code
I solved my own issue 
I called my table twice in my FROM line. Doh.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|