•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 430,124 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,332 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 319 | Replies: 2
![]() |
•
•
Join Date: Jun 2008
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
The following Code is causing an error when I try to set the AdoConn = New Connection. I receive an "Invalid Use of New Keyword" error. Can I get some guidence as to why? Thanks.
Dim adoRecordset As Recordset
Private Sub Form_Load()
Dim adoConn As Connection
Set adoConn = New Connection
Dim str As String
Dim sqlName As String
Me.Caption = "Company Database"
'' Set adoConn = Nothing
'Next three lines opens the Jones.mdb database.
adoConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Jones.mdb;Persist Security Info=False"
Set adoRecordset = New Recordset
str = "select * from tblToDo"
adoRecordset.Open str, adoConn, adOpenDynamic, adLockOptimistic Last edited by Tekmaven : Jul 24th, 2008 at 2:03 am. Reason: Code tags
•
•
Join Date: Feb 2008
Location: Sivakasi, Tamilnadu, India
Posts: 460
Reputation:
Rep Power: 1
Solved Threads: 81
Hi, I think no error here. I check it out. But try this
Also try ADODB.RecordSet
ADODB.Connection 'Instead of using Connection
Also try ADODB.RecordSet
Last edited by selvaganapathy : Jul 23rd, 2008 at 1:41 pm.
KSG
Hi,
Recordset also need to be decalred as New..
also give Full Path of the Database in connection string..
Regards
Veena
Recordset also need to be decalred as New..
vb Syntax (Toggle Plain Text)
Dim adoRecordset As New ADODB.Recordset
also give Full Path of the Database in connection string..
Regards
Veena
Last edited by QVeen72 : Jul 24th, 2008 at 2:49 am.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: How to import Xml file into a table in MS-ACCESS database using Visual Basic 6.0?
- Next Thread: Copying cells from one worksheet to another in transposed manner


Linear Mode