Create User Accounts on VB 6.0 application
I'm trying to code a create new account button, but what it does is that it deletes the first record existing on the database. I would like help to create usr accounts without affecting the ones created, for an application that has a Log In form. Here is the code:
Private Sub cmdCrearCuenta_Click()
Dim fldUsuario As String
Dim fldContrasena As String
Dim objDbRs As ADODB.Recordset
Dim objDbCon As ADODB.Connection
Dim strSQl As String
Set objDbCon = New ADODB.Connection
objDbCon.Open "Provider=Microsoft.Jet.OleDB.4.0;Data Source=G:\Comp 2400\Test_Video_Club\dbLogIn2.mdb"
strSQl = "SELECT fldUsuario, fldContrasena From tblLogIn where fldUsuario = '" & txtUsuario.Text & "'"
Set objDbRs = objDbCon.Execute(strSQl)
If fldUsuario = "" Or fldContrasena = "" Then
frmLogin.AdoLogIn.Recordset.AddNew
frmLogin.cmdCancelar.Enabled = False
Else
frmLogin.AdoLogIn.RecordSource = "select fldUsuario, fldContrasena from tblLogIn where fldUsuario='" & txtUsuario.Text & "'"
frmLogin.cmdCancelar.Enabled = True
Thanks for your kind attention
Dilsia Martinez

