Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Connecting to MSAccess DB using Data Control & SQL
Author:
Gibb Philip B. Manaog
E-mail:
Click to e-mail author
Submitted:
7/15/2006
Version:
VB6
Compatibility:
VB6
Category:
Databases
Views:
13426
This code snippet will connect your application to your msaccess database using data control and sql syntaxx. very easy to learn and can work even in network database. any comments on this code snippet just e-mail me.
Declarations:
'add a data control to your app 'add a command button too
Code:
Private Sub Form_Load() Data1.RecordsetType = 1 Data1.DatabaseName = Your Database Path 'ex. c:\\try.mdb End Sub Private Sub Command1_Click With Data1 .RecordSource = "SELECT * FROM yourtable" .Refresh With .Recordset If .BOF = True Then Msgbox "No Current Record" Else Msgbox "Current Records Found" End If End With End With End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement