Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

I need the saving command...

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
leeboonseong
Asked:
leeboonseong
1 Solution
 
rkot2000Commented:
what ?????????????????????????. need more info
0
 
K7Commented:
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
 
Ryan ChongCommented:
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
 
leeboonseongAuthor Commented:
Just want to said thank you for ur help.bye bye. where r u form?
0
 
K7Commented:
where am i from??
Melbourne Australia
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now