I am wrking on a VB6 project,and I m new to this,I need to save the inputs values from the text boxes from the VB form,and using the command button,i need to save the data into the access database which i had created named Dtldb.mdb
How do I use Data control for this?????
How do I do this,plz help me,I jst don't know how to do this:S

9 Years
Discussion Span
Last Post by debasisdas

better use ADODB library for the purpose. try the sample code below

con.begintrans        'con-----adodb connection object
con.execute "your sql insert statment here"

Vil ths work?????

'Dim dynData As Recordset
'Dim strsql As String

'strsql =" insert into Details values('"& intPsno"',"& strName","& strNtrExp",'"& intAdv"','"& intAccno"')"
'Set dynData = Wipdb.OpenRecordset(strsql, dbOpenDynaset, dbConsistent, dbOptimistic)
''Start db transaction
' BeginTrans
'On Error GoTo RollbackDetailUp
'ErrorinTrans = False
'dynData.LockEdits = False

''Commit DB Transaction
' CommitTrans

and how vil i save the value from the frame control to the database,ie. i added 2 radio btn,n need to update d database according to d selection.Hw cn i achieve ths????


try the following

dim con as new adodb.connection

con.open "your connection string here"

add my previous code after this line

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.