Problems using ADODB and adPromptNever

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
important 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 support 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




.



Relevant Pages

  • Re: Problems using ADODB and adPromptNever
    ... on startup that it is correctly linked to SQL Server. ... prompt to the value for adPromptNever. ... I suspect the OLEDB provider does not support this property, ...
    (microsoft.public.data.ado)
  • Re: Linked Table Password
    ... Prompt When Opening Linked Table" - ... recreating the links to the SQL Server ... > relationships again after the automated process. ... These connections can be DSN or DSN-less connections, ...
    (microsoft.public.access.security)
  • Corrupt registry? CONFIGSYSTEM missing or corrupt
    ... I went into msconfig utility under the Startup tab. ... I was able to do this and get to the C:\> prompt in the recovery console. ... Administrator password prompt appearing when I entered the Recovery console, ... Microsoft and it said "If an invalid or nonstandard partition table signature ...
    (microsoft.public.windowsxp.general)
  • RE: Corrupt registry? CONFIGSYSTEM missing or corrupt
    ... I went into msconfig utility under the Startup tab. ... > I was able to do this and get to the C:\> prompt in the recovery console. ... > Administrator password prompt appearing when I entered the Recovery console, ... > Microsoft and it said "If an invalid or nonstandard partition table signature ...
    (microsoft.public.windowsxp.general)
  • Re: Security bug?
    ... SQL Server 2000 Setup has been prompting for a password for sa since RTM, ... This is nothing new with SP3. ... it's only a prompt and the ...
    (microsoft.public.sqlserver.security)