p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: VBScript Programmer's Reference, 1st, 2nd, and 3rd editions (http://p2p.wrox.com/forumdisplay.php?f=51)
-   -   Can't Create RecordSet from Access conneciton (http://p2p.wrox.com/showthread.php?t=57149)

nickabbey April 26th, 2007 09:19 AM

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!

All times are GMT -4. The time now is 04:02 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.