Solved

I need the saving command...

Posted on 2001-06-21
5
147 Views
Last Modified: 2010-05-02
Hi,
  see u all again...this time is the problem that doing the saving...i already done my program ,now I have to save it to the database. which is separate to a lot of fields...so what I need to do and also what is the best way..thanks again a lot of expert there..thans..
0
Comment
Question by:leeboonseong
5 Comments
 
LVL 5

Expert Comment

by:rkot2000
ID: 6215112
what ?????????????????????????. need more info
0
 
LVL 1

Accepted Solution

by:
K7 earned 50 total points
ID: 6215319
Hi
To trite to a DB i would use ADO, for the folowing code to work you have to add Microsoft ActiveX Data Object. you need version 2.6 to ba able to use Access 2000. Also the conection string in the code id for a access 2000 DB located in the same directory as the program.

Dim Con As New ADODB.Connection
Dim RS As New ADODB.Recordset

Con.Mode = adModeReadWrite
Con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\NameOfDB.mdb;Persist Security Info=False"
Con.Open

RS.Open "NameOfTable", Con, adOpenKeyset, , adCmdTable
RS.AddNew
RS("FieldName1") = "Value to save1"
RS("FieldName2") = "Value to save2"
RS("FieldName3") = "Value to save3"
RS.Update

this is probably one of the better ways of saving the data to a DB but there are may more and partly simpler ways

hope this was helpfull

Cat
0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 6216629
Hi Lee, just comment that Before you do your data entries, besure your database is already normalized, reduce those duplication and redundancy.

Use ADODB.Connection as it's the faster way to save data if compared with ADODC Data Control.
0
 

Author Comment

by:leeboonseong
ID: 6222472
Just want to said thank you for ur help.bye bye. where r u form?
0
 
LVL 1

Expert Comment

by:K7
ID: 6222684
where am i from??
Melbourne Australia
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question