|
-
Oct 1st, 2000, 12:31 PM
#1
Thread Starter
Member
Hello all. I have a simple qustion here. I have an access database call club.mdb
Now I know this code here to set up the object:
Set db = DBEngine.OpenDatabase("c:\club.mdb")
Set rs = db.OpenRecordset("customers", dbOpenTable)
I also know how i can read data from my databse like:
d
im var as string
varid=rs.fields("ID")
But how can I write to the database. I dont want to use the bound controls eother. I just want to change the first entry in the IF field
thanks for any help
-
Oct 1st, 2000, 01:00 PM
#2
Use SQL.
Code:
INSERT INTO myTbl (field1, field2) VALUES ("myval1", "myval2");
-
Oct 1st, 2000, 01:27 PM
#3
Thread Starter
Member
Sorry for my ignorace, but im also very new to sql. Could you write the code more exact
thanks again
-
Oct 1st, 2000, 02:24 PM
#4
SQL is always good, but you can write to the database using DAO with either AddNew/Update or Edit/Update.
To add a new record:
rs.Addnew
' Fill in data for each field
rs!Field1 = "Whatever"
rs!Field2 = "Whatever"
...
rs!FieldX = "Whatever"
rs.Update
To update an existing record, you must first move to the record that you want, and then do the following:
rs.Edit
' Fill in data for each field you want to change
rs!Field1 = "Whatever"
rs!Field2 = "Whatever"
...
rs!FieldX = "Whatever"
rs.Update
"It's cold gin time again ..."
Check out my website here.
-
Oct 1st, 2000, 02:41 PM
#5
Thread Starter
Member
How can i move to that field. I cant get the find first command to work with this.
thanks for all the help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|