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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection Object Issue

Status
Not open for further replies.

MMund

Programmer
Oct 9, 2007
57
CA
I'm having a problem, as follows:
I'm trying to run a SQL stmt with the following code:
rcser is a recordset, objConn is my connection object

<code>
mysql = "SELECT ProgID, ProgName from tblProgrammer where Active = true order by ProgName"
with rcset
.Open mysql, objConn
.MoveFirst
end with
</code>

and am getting the following error on the Open statement:

ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

My objConn object comes from an include file, as follows:

<code>
DIM MDBFile
MDBFile = Server.MapPath("/ISProjects/Data/PTR.MDB")

dim objConn
set objConn = Server.CreateObject("ADODB.Connection")
With objConn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "Data Source=" & MDBFile
.Open
end With
%>
</code>

This works everywhere else in my project, and I cant see what I'm doing wrong.
 
Not sure what data type your "Active" field is supposed to be, but your problem probably lies there. If it is a bit datatype, then use 0 or 1. If it is a text, then use:
Code:
mysql = "SELECT ProgID, ProgName from tblProgrammer where Active = [COLOR=red]'[/color]true[COLOR=red]'[/color] order by ProgName"

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top