bungek84 -2 Newbie Poster

hi guys..
i got one big problem rite now..currently i'm handling new project using VB 6 and MS SQL Server as host server. Rite now i'm stuck at store/save data into the server. Previously, i'm using C#.Net and it success but then i'm not sure whether the code from .Net can be used in VB 6 or not..the system can't run..hope someones can teach me..

Regards,
ct

Here my example code:

Private Sub SaveData()
'conn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;password ='999999';Data Source=(local);Initial Catalog =TGB"
Dim cmd As New Command
Dim facID As New ADODB.Parameter
Dim lineno As New ADODB.Parameter
Dim timedate As New ADODB.Parameter
Dim blockno As New ADODB.Parameter
Dim glovetype As New ADODB.Parameter
Dim Size As New ADODB.Parameter

cmd = " INSERT INTO DMF_ERP_TumTag(FactoryID, TTLineNo, DateTime, " _
& "BlockNo, GloveType, TTSize)" _
& " VALUES ('" & cboFacId.Text & ", " & ComboBox1.Text & "," _
& " #" & txtDateTime.Text & "#, " & Text2.Text & ", " & cboGloveType & ", " & cboSize.Text & " ')"

rs.Open strsql, Conn2, adOpenStatic, adLockReadOnly

facID.Value = cboFacId.Text
cmd.Parameters.Append facID
lineno.Value = ComboBox1.Text
cmd.Parameters.Append lineno
timedate.Value = txtDateTime.Text
cmd.Parameters.Append timedate
blockno.Value = Text2.Text
cmd.Parameters.Append blockno
Set rs = sqlCommand.Execute
Conn2.Close