|
-
Apr 4th, 2000, 08:15 AM
#6
Thread Starter
New Member
Maybe there's something totally wrong with me, I dont know, but I just can't get the darn thing to add a record!! I tried your code for opening the recordset, but that didn't work so I removed the 3 optional flags at the end and it still didn't work :-)
userdb is the DSN name aswell as the database name. userinfo is a table containing about 30 fields for user information. Perhaps it didn't add it because I didn't include all the fields to be added, only included login & password?
Do you think I could get in touch with you via email or ICQ? You're the only person who has helped me like this, and I desperately need to get this done for work. My email is [email protected], and ICQ is 1510247
Dim wrkDatabase As Workspace
Dim dbsDatabase As Database
' Create a workspace
Set wrkDatabase = CreateWorkspace("userdb", "", "", dbUseODBC)
' Open the database
Set dbsDatabase = wrkDatabase.OpenDatabase("userdb", dbDriverNoPrompt, False, "ODBC;DSN=userdb;")
Dim rstData As Recordset
Set rstData = dbsDatabase.OpenRecordset("SELECT * FROM userinfo")
' Adding a NEW Record
rstData.AddNew
rstData("login") = "matt"
rstData("password") = "iscool"
rstData.Update
rstData.Close
Set rstData = Nothing
' When finished with it
dbsDatabase.Close
wrkDatabase.Close
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
|