silent connection

silent connection

Post by Keith Thorn » Wed, 24 Mar 1999 04:00:00



Is there any way to connect to an SQL server using
DAO in such a way that if there is an error no messages
will be shown, but instead it will let me handle the errors
instead.

In other words, can I set a flag or something to create a silent
connection.

thanks in advance
Keith

 
 
 

silent connection

Post by Gert Draper » Wed, 24 Mar 1999 04:00:00


No you can not, you need to handle all informational messages as well as
error messages. What is so hard about that ?

-GertD


 
 
 

silent connection

Post by Rick Sawtel » Wed, 24 Mar 1999 04:00:00


Since you are working with DAO, I'm assuming that you are using VB to gain
access.  With DAO, you can go through the JET database engine, or through
ODBCDirect (or through the VBSQL API's).

Try setting up an error handler in your code:

Sub MyConnectCode()
    Dim db as Database
    dim ws as Workspace
    Dim rs as Recordset

    On Error Goto EH
    Set ws = DBEngine.CreateWorkspace("","", Admin,dbUseODBC)
    Set ws.db = OpenDatabase("",False, False,
"ODBC;DATABASE=pubs;UID=sa;PWD=xxx;DSN=Frogger")
    Set rs = db.OpenRecordSet("some sql string")
    ...
    ...
    ...
    Exit Sub
EH:
    If Err.Number = xxxxx then
        .....
End Sub

Hope this helps
--
Rick Sawtell MCP, MCT, MCSD

We are what we repeatedly do. Excellence, then, is not an act, but a
habit. -- Aristotle


>Is there any way to connect to an SQL server using
>DAO in such a way that if there is an error no messages
>will be shown, but instead it will let me handle the errors
>instead.

>In other words, can I set a flag or something to create a silent
>connection.

>thanks in advance
>Keith

 
 
 

1. silent connection

Is there any way to connect to an SQL server using
DAO in such a way that if there is an error no messages
will be shown, but instead it will let me handle the errors
instead.

In other words, can I set a flag or something to create a silent
connection.

thanks in advance

Keith

2. Query syntax with space in column name

3. Silent install of FTS

4. instant reply needed

5. SQL 7.0 Silent ODBC Driver Install

6. Sequential data file problem

7. Calling a procedure in "silent" mode

8. Error message: VOC.EXE

9. silent mode, or suppressing info from sp_helprole

10. MSDE 2000 silent install

11. MSDE Silent Install errors with disk error

12. Silent installation of SP3

13. DISABLE AUTOREBOOT WHEN MSDE IS INSTALLED IN SILENT MODE