473,465 Members | 1,934 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How do i connect a VB 6.0 Form to an Access database

8 New Member
hello,

What are the steps that i should perform or what is the piece of code that i should use to connect an access database to a VB 6.0 Form? What is the piece of code for inserting , deleting viewing, editing data in the database? Where should i put the code?

Thanks
Nov 28 '06 #1
1 51725
Sky86
5 New Member
hello,

What are the steps that i should perform or what is the piece of code that i should use to connect an access database to a VB 6.0 Form? What is the piece of code for inserting , deleting viewing, editing data in the database? Where should i put the code?

Thanks

u got 2 option
1. using ado data control
2. using coding

using adodc
1. add a adodc
2. in the properties change
connect = Access
databasename = 'find the access file'
recordsource = 'the name of the table that want to link'
3. if want to link with the text box, in the change the properties
datasourse = 'the name of the adodc'
datafield = ' the field in the table that want to link'
4. coding of adding new records
Expand|Select|Wrap|Line Numbers
  1. data1.recordset.AddNew
5. coding of delete
Expand|Select|Wrap|Line Numbers
  1. data1.recordset.delete
6. coding of edit
Expand|Select|Wrap|Line Numbers
  1. data1.recordset.edit
7. coding of update
Expand|Select|Wrap|Line Numbers
  1. data1.recordset.update
8. coding of cancel update
Expand|Select|Wrap|Line Numbers
  1. data1.recordset.cancelupdate
9. move data or record
Expand|Select|Wrap|Line Numbers
  1. data1.recordset.movenext
  2.     data1.recordset.movefirst

using coding
try use this coding the different of other action is in SQL only

Expand|Select|Wrap|Line Numbers
  1. Dim con As New ADODB.Connection
  2. Dim con_string As String
  3. Dim sql As String
  4. Dim rs As New ADODB.Recordset
  5. con_string = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = " & App.Path & "\" & "abc.mdb;"
  6. con.Open con_string
  7.  
  8. sql = "select * from test where matrik = 123"
  9. Set rs = con.Execute(sql)
hope it help

-Sky86
Nov 28 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Krista | last post by:
Hi, Hope you guys can help me out~~ I have a config.php file. I want to conncet to my own mysql version. When i run the config.php file as below, i get all successful message. However, when i take...
0
by: Kate Perry | last post by:
I am trying to execute a query on a db2 database using the dbi module. I'm wondering if someone can take a look at my code and tell me what I'm doing wrong. I'm assuming it's a problem with my...
1
by: Yanick Quirion | last post by:
Hi all, I'm trying to find a simple code to connect to an Oracle Database (9i) with C under linux. I have a script that read a form from the web and I want to access my Oracle database with...
1
by: Dave | last post by:
I am trying to learn .NET with the standard edition of VC++.NET 2003 Standard edition. When I use the wizard in the toolbox to connect to a non-microsoft ODBC data source, I get the error message...
2
by: CM Manager via DotNetMonster.com | last post by:
I am very frustrated due to this exception error I am receiving. I've tried searching numerous user support groups, Microsoft Support Net, Google, etc. and haven't found exactly my situation....
2
by: BOS | last post by:
Hi there, I just create a form that contains name, Address, City, State, Zip, Question Checked box, and dropdown list selection for the user to fill-out the answer in the texbox, checkbox or...
3
by: LamSoft | last post by:
I am not going to write a aspx to connect a SQL Server... but it tries to connect the SQL Server... Some of the Code.. protected void LoginButton_Click(object sender, EventArgs e) { if...
3
hariharanmca
by: hariharanmca | last post by:
Subject : I want to Connect Flash with Database ('Access' or 'Sql Server' or some Idea). My tool is to create a form desigen (Login Register) in flash and connect it to database. It will...
0
by: asad56 | last post by:
I am workin with a superstore managment project. I connect Access database with main form . Then it work properly. But now I connect same database with another table or field in another form which is...
8
by: BD | last post by:
I am developing C# win form app to work with remote database on SQL Server 2005. Problem scenario is as follows: 1. a form is open that has downloaded dataset to local cache 2. computer is...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.