Hi
I am a newbie to VB6.. Ive read many helps and all and i am trying to make a Access DB driven Project.. Here is a simple code for adding some form info to the database..
VB Code:
Private Sub cmdadduser_Click()
'Checking for no field to be empty
If txtid.Text = vbNullString Or txtpassword.Text = vbNullString Or _
txtname.Text = vbNullString Or txtaddress.Text = vbNullString _
Or txtemail.Text = vbNullString Or txtphone.Text = vbNullString Then
MsgBox "All Fields Must Contain Data", vbCritical, "Error"
Else
'Adding the Record
rs.AddNew
rs("ebay_id") = txtid.Text
rs("password") = txtpassword.Text
rs("name") = txtname.Text
rs("address") = txtaddress.Text
rs("email") = txtemail.Text
rs("phone") = txtphone.Text
rs.Update
MsgBox "You for Registering Please Login Now", vbOKOnly, "Successful"
Unload frmnewuser
frmwelcome.Show
End If
End Sub
Private Sub cmdreset_Click()
' Reseting All textboxes
txtid.Text = ""
txtname.Text = ""
txtpassword.Text = ""
txtaddress.Text = ""
txtemail.Text = ""
txtphone.Text = ""
txtid.SetFocus
End Sub
Private Sub cmdreturn_Click()
Unload Me
frmwelcome.Show
End Sub
Private Sub Form_Load()
Dim db As Database
Dim rs As Recordset
Dim ws As Workspace
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase(App.Path & "\db.mdb")
Set rs = db.OpenRecordset("user_info", dbOpenTable)
End Sub
According to me everything is fine.. But when i run the program.. I get the following error
424 : Object required
on line
Please tell me what Am i doing wrong and what is to be corrected?? Maybe my connection is not right??