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

Vb Script

Status
Not open for further replies.

eNerGiZer0101

IS-IT--Management
Jul 5, 2004
57
0
0
CA
G'Day to all,
When I try to run my script I get the following message:

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

The error message is for the following line:

oRS.Open SqlTxt , Conn


Cheers to all.



Will
 
How are Conn and RS instantiated and SqlTxt populated ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Set oConn = CreateObject("ADODB.Connection")
oConn.Open "DSN=SQL"
Set oRS = CreateObject("ADODB.RecordSet")
oRS.CursorType = 1 'AdOpenKeyset... Gave the good Record Count


what do you mean SQL txt populated?
 
Replace this:
oRS.Open SqlTxt , Conn
By this:
oRS.Open SqlTxt , oConn
And put an Option Explicit instruction at the beginning of your script.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Code:
Option Explicit

Set oConn = CreateObject("ADODB.Connection")
oConn.Open "DSN=SQL"
Set oRS = CreateObject("ADODB.RecordSet")
oRS.CursorType = 1

oRS.Open SqlTxt , oConn

Granted this doesn't do much, but it is all of the code you've privided with all of the changes PHV suggested.

Nathan aka: zaz (zaznet)
zaz@zaz.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top