Wrox Programmer Forums
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2004, 02:05 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old March 3rd, 2004, 03:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, while at lunch I thought "I am going to reboot my machine when I get back" and now everything is fine. I appreciate any thought you may have given this.

When all else fails reboot!

Larry Asher
 
Old June 9th, 2004, 10:12 PM
Authorized User
 
Join Date: May 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to myedu2k4
Default

Hi
Thing sometime just happen like that. That is why we believe in God.Right?

Pheap






Similar Threads
Thread Thread Starter Forum Replies Last Post
User controls lose data edibusl ASP.NET 2.0 Basics 0 October 7th, 2006 09:10 AM
DTSGlobalVar lose its value in VBScript willi SQL Server DTS 2 August 29th, 2005 03:26 PM
Avoid Warning Message on C lose Windows qazi_nomi Javascript 9 September 11th, 2004 11:19 AM
Why do I lose 0 Zero's when calculating? easybee Classic ASP Databases 1 December 18th, 2003 12:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.