ODBC - Object variable or With block variable not set (Error 91) 
Author Message
 ODBC - Object variable or With block variable not set (Error 91)

Hi,
Can anybody provide me with any clues pn to what I'm doing
wrong on the module below?  The last line gives me an
error 91, I'm just totally stumped!

Sub GetMgrName()
         On Error Resume Next
         Dim WrkSp As Workspace
         Dim qdf As QueryDef
         Dim cnn As Connection
         Dim strConnect As String
         Dim strSQL As String
         Set WrkSp = CreateWorkspace
("ODBCDirect", "sa", "dangerwr", dbUseODBC)

strConnect="ODBC;DATABASE=EMPDB01;UID=sa;PWD=dangerwr;DSN=D
LH Base SQL Server"
         Set cnn = WrkSp.OpenConnection("Connection1",
dbDriverNoPrompt, True, strConnect)
         cnn.Execute strSQL
         On Error GoTo 0

          Set qdf = cnn.CreateQueryDef
("NewQueryDef", "SELECT * FROM dbemp01")



Sun, 06 Jun 2004 01:34:09 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. error 91 Object Variable o on with block variable is not set

2. Object variable or With block variable not set (Error 91)

3. Object variable or With block variable not set (Error 91)

4. Error 91-Object or block with variable not set

5. Error 91 - object or block width variable not set

6. 91 Object variable or with block not set

7. Object variable or With block variable not set (Trapping SQL errors)

8. Error in DTS - Object variable or With block variable not set

9. Cube processing error: Object variable or With block variable not set

10. Error: Object variable or with block variable not set

11. HELP : Error 91 : Run-Time Error 91 Object Variable or With

12. Object variable or With block variable not set


 
Powered by phpBB® Forum Software