|
| ||||||||||
| Tags: asp, java, ms access, sql, visual basic |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to connect the VB6 with MS Access 2003?
|
|
#2
| ||||
| ||||
| Re: How to connect the VB6 with MS Access 2003?
As per my knowledge the Visual Basic 6 is only able to manage the MS Access 97 file formats. So, before connecting the MS Access 2003 file to the VB 6, convert the that Access 2003 file to the Access 97 format, because it supports only the Access 97 files. This converting can be done easily, Goto MS Access 2003-- Open your database file--Tools--Database Utilities--Convert Database --To Access 97 file Format. Once this is done you will not able to do any modification in your file so, take this after completing the modification or create a new access 97 file every time you make changes. |
|
#3
| ||||
| ||||
| Re: How to connect the VB6 with MS Access 2003?
To connect Visual Basic 6 to the Ms Access 2003 file, you need to use the DAO or ADO as connection provider to the database. For this, inside Menu, put a click on Microsoft ActiveX Data Objects. And in your project General Declaration Area, have to write this code: Dim con As New ADODB.Connection Dim r1 As New ADODB.Recordset And in Form's Activate Event con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="your database complete path";Persist Security Info=False" con.Open r1.Open " select * from (your database name)", con, adOpenStatic, adLockPessimistic Hope you will able to understand this code, and can apply in your project. |
|
#4
| ||||
| ||||
| Re: How to connect the VB6 with MS Access 2003?
I would prefer to use the ADO(ActiveX Data Object) to connect VB6 to MS Access file. The ADO is the most basic and simple way to connect to the database. Basic of the connection is as follow: Dim con As ADODB.Connection, recsource As ADODB.Recordset Dim strCon as String, str1Sql as String Set con = New ADODB.Connection Set recsource = New ADODB.Recordset strCon = "Provider=Microsoft.Jet.OLEDB.4.0;"& "Persist Security Info=False;"&"Data Source=\\Server\Share\DatabaseName.MDB" con.Open strCon str1Sql = "SELECT * FROM Tablename " recsource.Open str1Sql, con, adOpenKeyset, adLockOptimistic Hope this code will make you understand how to connect MS Access.
__________________ The FIFA Manager 2009 PC Game |
|
#5
| ||||
| ||||
| Re: How to connect the VB6 with MS Access 2003?
I know one of the step to connect the Visual Basic to the MS Access2003, and it goes like this:Goto "Control Panel"--Click on "Performances and Maintenance"--Click on the Administrative tools option--DoubleClick on Data Sources (ODBC)--Note that you watch a dialog box--in that Click System dsn--After that Click on add-- Again DoubleClick Access2003 driver .mdb--Click Select then find the Access2003 database which you saved--then click on OK--In the Data Source Name option type the filename of the Ms Access Database( like db1.mdb)--Click OK. Press enter. Hope this method will allow to use the MS Access2003 files in Visual Basic 6.
__________________ Grand Theft Auto 4 PC Video Game |
|
#6
| |||
| |||
| Re: How to connect the VB6 with MS Access 2003?
According to me you should use either the ADO(ActiveX Data Object) or DAO(Data Access Object). This are the basic and most simple method used to connect VB 6 to the MS Access. The basic code for ADO is as follow: In general declaration Dim con as Adodb.connection, rs as Adodb.recordset Dim sql1 as String, sql2 as String Private Function Connection() Set rs = New ADODB.Recordset Set con = New ADODB.Connection sql1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" Fullpath of database" & ";Persist Security Info=False" con.Open (sql1), , , 0 End Function Call this Connection in which ever form you want the database connection. Hope you will get solve soon and your project gets complete on time. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to connect the VB6 with MS Access 2003?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| XP VPN to SBS 2003 will not connect | lbischoff | Small Business Server | 3 | 05-11-2011 03:09 AM |
| Read Access 2003 files with Access 2007 | Kendal-J | Windows Software | 2 | 26-05-2010 05:57 PM |
| Connect Windows 7 to SBS 2003 | Galiher | Small Business Server | 2 | 30-04-2010 06:17 PM |
| Ms Access 2003 Issue | Esantill | Windows Software | 2 | 27-03-2009 09:12 PM |
| Remote Access and Outlook Web Access on SBS 2003 | mannuraama | Small Business Server | 4 | 04-06-2008 04:22 AM |