Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Data to a database from VB6

Status
Not open for further replies.

jedel

Programmer
Jan 11, 2003
430
AU
Call me ignorant. But I am new at this game. I have created an relational database using Access 97, and have been able to connect to this database using a Data Environment in VB6. (Please don't ask me if its ADO or OBDC or some conglomerate of letters. All I know is I created a new data project and set the properties in the data environmet.)

Everything is working fine if all I want to do is view data.

What do I need to do to add data??? I currently have two forms in the VB project. The first is to view already entered recordsets in the database with a button that can be clicked to add a new record. This is where I'm stuck. any help would be great.

Rergards

JEDEL
 
Maybe this will help you on your way:

Dim Conn As Connection

Set Conn = DataEnvironment.YourConnection

Conn.Execute ("INSERT INTO tablename VARIABLES (" & txtRownumber & ", '" & txtName & "')")

You can use this code behind a save button to insert the data in the database. In the example I used two textfields for userinput (txtRownumber and txtName).

Greetings,

Jan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top