hi all!
I'm usuing VB 5.0. I need to store data getting input in VBform in MSAccess data base.
I tried with ADO connection but its not working.

Can any one send me the basic code to store data in MSaccess and to read the data.

You help is highly appreciated.


Depends, you only need to store data?

stringquery = "INSERT INTO user SET name = '" & name.Value& "';"

Then you can just use DoCmd.RunSQL(stringQuery)

Or dou you want to extract data from the database?

in that case:

Dim Conn As ADODB.Connection
Dim rs As New ADODB.Recordset

Set Conn = CurrentProject.Connection
Set rs = New ADODB.Recordset

queryString = "SELECT * FROM user WHERE userid = " & userid.Value & ";"

rs.Open queryString, Conn, adOpenKeyset, adLockOptimistic

Do Until rs.EOF
name = rs(0)

hopes it helps...

to store data in database you need to use Insert query from frontend not select .