|
-
April 5th, 2000, 03:09 PM
#1
ADODB Connection Error. any help please?
I have VB6PE and Access 97. I used VB's wizard to create my form for me. When I went to run the following code, it gave me an error: "Compile Error: Invalid Use of New keyword". Is this a glitch/bug? Am I missing a DLL/reference?
Dim sSQL As String
Dim dfwConn As ADODB.Connection
Dim i As Integer
Dim j As Integer
Dim m_iMaxCol As Integer
' set strings
sConnect = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;User ID=Admin;Data Source=H:\DTC\UnAffirm\unaffirm.mdb;Mode=Share Deny None;Extended Properties=';COUNTRY=0;CP=1252;LANGID=0x0409';Jet OLEDB:System database='';Jet OLEDB:Registry Path='';Jet OLEDB atabase Password='';Jet OLEDB:Global Partial Bulk Ops=2"
sSQL = "select Affirm,Rec_Type,AffirmNum from tblEquity Order by AffirmNum"
' open connection
Set dfwConn = New Connection
dfwConn.Open sConnect
The error highlights the Set dfwConn line. Thanks for any help.
Wendy
Wendy
-
April 5th, 2000, 03:30 PM
#2
Re: ADODB Connection Error. any help please?
try using
Set dfwConn = New ADODB.Connection
That should work
-
April 5th, 2000, 03:47 PM
#3
Re: ADODB Connection Error. any help please?
THANK YOU!!! That did it! It errored again on a New Recordset code line. I added the ADODB before it and it is good-to-go! Thanks so much. I think this is the first time anyone has responded to a question I've written on here. Appreciate it.
Wendy
-
April 5th, 2000, 07:07 PM
#4
Re: ADODB Connection Error. any help please?
Make sure your referencing ADO Components in your program.
The line Set dfwConn = New Connection try
Set dfwConn = New ADODB.Connection
-
April 6th, 2000, 11:45 AM
#5
Re: ADODB Connection Error. any help please?
Replace the code "Set dfwConn = New Connection" with Set dfwConn = New ADODB.Connection. Hope it will work.
Sym13
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|