Solved

I need the saving command...

Posted on 2001-06-21
5
146 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
Comment Utility
what ?????????????????????????. need more info
0
 
LVL 1

Accepted Solution

by:
K7 earned 50 total points
Comment Utility
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 49

Expert Comment

by:Ryan Chong
Comment Utility
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
Comment Utility
Just want to said thank you for ur help.bye bye. where r u form?
0
 
LVL 1

Expert Comment

by:K7
Comment Utility
where am i from??
Melbourne Australia
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now