Help Mr. ADMIN

I have this typical data.mdb file with a password (moviemaker). Now I want to access the tblUser through my login window. Now I encounter an error "Not a valid password". I know I didn't put the password of the data.mdb on the module of my program. I tried to manipulate it through your tutorial on the FAQ but it didn't work specially on the "DBPath" thing. Here is my code from my module. I don't know where to put the password. On this line --->> db.Open App.Path & "\data.mdb" is where the highlighted error occurs. I really don't know where to put the "Data Source="& DBPath &":Persist Security Info=False";Jet OLEDB:Database Password=moviemaker" Please help me about my problem. Option Explicit Public Enum InputType Date_Slash_Input = 0 Date_Dash_Input = 1 Numeric_Input = 2 Text_Input = 3 Currency_Input = 4 End Enum Global windowMode As Boolean Global dbReport As New ADODB.Connection Global rsreport As New ADODB.Recordset Public Sub OpenConn(ByVal db As ADODB.Connection, ByVal rs As ADODB.Recordset, strSQL As String) db.CursorLocation = adUseClient db.Provider = "Microsoft.Jet.OLEDB.4.0" db.Open App.Path & "\data.mdb" rs.Open strSQL, db, adOpenDynamic, adLockOptimistic End Sub Public Sub CloseConn(ByVal rs As ADODB.Recordset, db As ADODB.Connection) rs.Close db.Close End Sub Public Sub ComboLoad(ByVal cbo As ComboBox, ByVal strSQL As String, ByVal fldval As String) Dim dbTemp As New ADODB.Connection Dim rsTemp As New ADODB.Recordset cbo.Clear OpenConn dbTemp, rsTemp, strSQL With rsTemp While Not .EOF = True cbo.AddItem .Fields(fldval) .MoveNext Wend End With CloseConn rsTemp, dbTemp End Sub Public Function ValidateInput(KeyAscii As Integer, Format As InputType, Optional Uppercase As Boolean) As Integer If (Format = Date_Slash_Input) Then If (KeyAscii > 57 Or KeyAscii 8) Then If (KeyAscii 47) Then KeyAscii = 0 End If End If End If ElseIf (Format = Date_Dash_Input) Then If (KeyAscii > 57 Or KeyAscii 8) Then If (KeyAscii 45) Then KeyAscii = 0 End If End If End If ElseIf (Format = Numeric_Input) Then If (KeyAscii 57) Then If (KeyAscii 8) Then KeyAscii = 0 End If End If ElseIf (Format = Text_Input) Then If (KeyAscii >= 65 And KeyAscii 57 Or KeyAscii 8 And KeyAscii 36 And KeyAscii 44 And KeyAscii 46) Then KeyAscii = 0 End If End If End If ValidateInput = KeyAscii End Function
Submitted byadminon Tue, 03/30/2010 - 08:36

Use this code: Public Sub OpenConn(ByVal db As ADODB.Connection, ByVal rs As ADODB.Recordset, strSQL As String) db.CursorLocation = adUseClient db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\data.mdb;Persist Security Info=False;Jet OLEDB:Database Password=moviemaker" rs.Open strSQL, db, adOpenDynamic, adLockOptimistic End Sub

sir, please help me how to use the update statement i don't know how... i have also question if this is my primary key id_no. example id_no 123 if i will update this to 124 this can be change or not?help me sir..write me please...

your help get usefull to me..thank you so much...what about the insert into table can you show me the syntax how to use this?....question again do i still need to use the .AddNew if i use the insert into table ?hoping for your positive responds...
Submitted byAnonymous (not verified)on Tue, 04/20/2010 - 11:16

In reply to by jem

ahhhmp i think ur needs suit here.. www.w3schools.com just visit that.. anyways in vb 6.0 yes u can use recordset to add new record or cn.execute where cn is ur connection e.g. set rs = new adodb.recordset rs.open "Select * from table1" rs.addnew() rs!field1 = values1 rs!field2 = values2 rs.update or cn.execute("Insert into table1(field1,field2) values('" & values1 & "', '" & values2 & "')") syntax: Insert into tablename(field,field) values( '" & somextexthere & "', '" & sometxthere & "') hope it will help u :) hehehe

sir also this one why we use this "Data Source="& DBPath &":Persist Security Info=False";Jet OLEDB:Database Password=moviemaker"..what is the purpose of persist security info..etc... can you help me so that i can fully understand the concept of this...hoping for your positive responds..

Add new comment