Good morning guys, I have a problem regarding the usage of the command button in VB 6. I dont know what codes what i will gonna use. How will i gonna call the records from the table using command button and saving it from another table?
Calling of records from table through command button and saving it to another table.
Collapse
X
-
Tags: None
-
Originally posted by bluethunderGood morning guys, I have a problem regarding the usage of the command button in VB 6. I dont know what codes what i will gonna use. How will i gonna call the records from the table using command button and saving it from another table?
Can you give us much more details of what you wanted to do. What database connection are you using? : ) -
Originally posted by lotus18bluethunder
Can you give us much more details of what you wanted to do. What database connection are you using? : )Comment
-
hi
open a new standarad exe project (if you are not familiar with vb6 then open new DataProject). create command button. and double click on it. add following code in the click event to connect the database and to access records from the table.
Dim cn As New ADODB.Connectio n
Dim rst As New ADODB.Recordset
With cn
.Provider = "MsDataShap e" 'I use DataShape you can modify as per your requirment
.Properties("Da ta Provider") = "Microsoft.Jet. OLEDB.4.0"
'use following line only if your database is password protected
.Properties("Ex tended Properties") = "Jet OLEDB:Database Password= yourPassword"
.Properties("Da ta Source") = App.Path & "\Data.mdb"
.Open
End With
rst.Open "Select * from YourTable", cn, adOpenDynamic, adLockBatchOpti mistic, 8
With rst
.MoveFirst
While Not .EOF
Debug.Print .Fields(0).Valu e
.MoveNext
Wend
End With
regards
manpreet singh dhillon hoshiarpurComment
Comment