View Single Post
Old April 26th, 2007, 09:19 AM
nickabbey nickabbey is offline
Registered User
Join Date: Apr 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't Create RecordSet from Access conneciton

Here's my code, Please help on why I get the error listed below:

Set cnUsers = CreateObject("ADODB.Connection")

cnUsers.ConnectionString = "Provider= Microsoft.Jet.OLEDB.4.0;" & _
                            "User ID = Admin;Password=;" & _
                            "Data Source=c:\poc.mdb"



Set rsUsers = CreateObject("ADODB.Recordset")
strSQL = "SELECT [Officer_Num,User_Id,FName,FName,MI] FROM USERS"
Set rSUsers = cnUsers.Execute(strSQL)

The error I get is:
H:\Scripts\NEW AD USER STUB.vbs(48, 1) Microsoft JET Database Engine: No value given for one or more required parameters.

Line 48 is: Set rSUsers = cnUsers.Execute(strSQL)

In the line:
strSQL = "SELECT [Officer_Num,User_Id,FName,FName,MI] FROM USERS"

everything between the [...] is in the same case as it appears in the Access DB.
Help Please!