Help! At a lose: SQL and VB
I am at a total lose! I have this application that has been running for nearly a year. I went in to do some debugging in regards to remote users ... and now I am receiving an error when I try to set the command objects active connection property equal to the database connection object.
I was testing different connection strings for the database. None seems to accomplish what I wanted to, so I put the original connection string back in place - just un-commented it.
Here is the connection string:
NewConnection.ConnectionString = "Provider=SQLOLEDB.1;" _
& "Integrated Security=SSPI;" _
& "Persist Security Info=False;" _
& "User ID=" & Trim(UserID) & ";" _
& "Initial Catalog=" & Trim(Catalog) & ";" _
& "Data Source=" & Trim(DataSource)
' Open the connection
NewConnection.Open
This is from a sub proc that receives the connection object as by reference.
The following is the code where the error occurs:
' Connect to the database
ConnectToDB gSQLUserID, gSQLCatalog, gSQLDataSource, gCn
Set gCmd.ActiveConnection = gCn
It connects to the database but give me an error on the Set. Error 3001 Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
Here is the value for the database connection object:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=larash;Initial Catalog=BDOCMGR;Data Source=Bco-sql1;
Any help would be greatly appreciate.
Larry Asher
__________________
Larry Asher
|