Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > ADO Data > Problems using ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 4248 of 4320
Post > Topic >>

Problems using ADODB and adPromptNever

by cbender@[EMAIL PROTECTED] Jun 16, 2008 at 10:15 AM

Previously I wrote some code for an Access 2003 application to verify
on startup that it is correctly linked to SQL Server. Since it was
im****tant that the driver not prompt the user and the rest of the
application uses DAO, I used the following code

    Set wksp = DBEngine.CreateWorkspace("", "", "", dbUseODBCCursor)
    Set db = wksp.OpenDatabase("", dbDriverNoPrompt, True, strTemp)

However Access 2007 does not sup****t this method, so I rewrote the
code using ADODB as follows:

strTemp = "Provider=SQLOLEDB.1;Data Source=MyServer;Initial
Catalog=Database;Integrated Security=SSPI"

Set conn = CreateObject("ADODB.Connection")
'conn.Properties("Prompt") = 4
conn.Open strTemp

The code runs fine as long as I don't attempt to set the property for
prompt to the value for adPromptNever (4).  (I'm using late binding
because the rest to the application uses DAO).  But as soon as I
attempt to set the property I get an error message "Object invalid or
no longer set"

Anyone have any thoughts on this?   99% of the time it would not be an
issue since the application will be correctly link, but if on the
first startup after install it cannot find the SQL Server, I don't
want the default prompt to appear but want to handle the problem using
a custom form.

Thanks in advance
Cheryl
 




 6 Posts in Topic:
Problems using ADODB and adPromptNever
cbender@[EMAIL PROTECTED]  2008-06-16 10:15:34 
Re: Problems using ADODB and adPromptNever
"Bob Barrows [MVP]&q  2008-06-16 13:30:20 
Re: Problems using ADODB and adPromptNever
cbender@[EMAIL PROTECTED]  2008-06-16 10:58:58 
Re: Problems using ADODB and adPromptNever
"Stephen Howe"   2008-06-17 12:57:38 
Re: Problems using ADODB and adPromptNever
"Bob Barrows [MVP]&q  2008-06-17 08:33:12 
Re: Problems using ADODB and adPromptNever
"Stephen Howe"   2008-06-17 15:34:45 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 15:27:19 CST 2008.