Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

convertion of vb code to vc++

1 view
Skip to first unread message

nasim

unread,
Dec 14, 2006, 1:17:28 AM12/14/06
to
Dim con As ADODB.Connection
Dim str_connect As String
Dim cmd As ADODB.Command
Dim vpara1, vpara2 As ADODB.Parameter
Dim vpara3 As ADODB.Parameter

Private Sub Command1_Click()
Set con = New ADODB.Connection
str_connect = "dsn=sqlD;uid=abo;pwd=abo"
con.Open str_connect, "abo", "abo"
Set cmd = New ADODB.Command
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "getnewlogkeysmodified"
Set vpara1 = cmd.CreateParameter("tablename", adVarChar, adParamInput,
40, "")
Set vpara2 = cmd.CreateParameter("keyname", adVarChar, adParamInput,
40, "")
Set vpara3 = cmd.CreateParameter("keyvalue", adBigInt, adParamOutput)
vpara1.Value = "INLOG"
vpara2.Value = "INLOGKEY"
cmd.Parameters.Append vpara1
cmd.Parameters.Append vpara2
cmd.Parameters.Append vpara3
cmd.ActiveConnection = con
Timer1.Enabled = True
cmd.Execute
MsgBox "VALUE OF NEW KEY" & cmd.Parameters("keyvalue").Value
End Sub

Private Sub Command2_Click()
Timer1.Enabled = False
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
End Sub


Private Sub Timer1_Timer()
cmd.Execute
For i = 1 To 1000
Next
con.Execute "insert into test values(" & vpara3.Value & ",'adoexe4')"
End Sub

I need this program to be written in vc++ I m not a c++ programmer so,
please provide complete program .
thanks
nasim

0 new messages