By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,475 Members | 1,915 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,475 IT Pros & Developers. It's quick & easy.

Can you Translate this to SQL????

P: 27
everyone can you traslate this to SQL... instead of ADDnew use INSERT
Private Sub Command1_Click()

With Adodc1.Recordset
.AddNew
!fldIDNUM = Text1
!fldDATE = tim3
!fldTIME = Time
!Name = Text2
!Position = Text3
!ShiftCode = Text4
!Line = Text5
!UpdatingOfficer = Text6
.Update
.Requery



End With
Adodc1.Refresh

Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text1.SetFocus




End Sub

Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Maan\Desktop\AMKOR Turnstyle\db1.mdb;Persist Security Info=False"
Adodc1.RecordSource = "SELECT * FROM Table1"
Adodc1.Refresh




End Sub>
Dec 23 '06 #1
Share this Question
Share on Google+
4 Replies


sashi
Expert 100+
P: 1,754
everyone can you traslate this to SQL... instead of ADDnew use INSERT
Private Sub Command1_Click()

With Adodc1.Recordset
.AddNew
!fldIDNUM = Text1
!fldDATE = tim3
!fldTIME = Time
!Name = Text2
!Position = Text3
!ShiftCode = Text4
!Line = Text5
!UpdatingOfficer = Text6
.Update
.Requery



End With
Adodc1.Refresh

Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text1.SetFocus




End Sub

Private Sub Form_Load()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Maan\Desktop\AMKOR Turnstyle\db1.mdb;Persist Security Info=False"
Adodc1.RecordSource = "SELECT * FROM Table1"
Adodc1.Refresh




End Sub>

Hi there,

Kindly refer to below syntax, hope you can complete the rest. Good luck & Take care.

Expand|Select|Wrap|Line Numbers
  1.   INSERT INTO table_name(field1,field2,field3,field4) values ('value1','value2','value3','value4') 
  2.  
Dec 23 '06 #2

P: 27
Hi there,

Kindly refer to below syntax, hope you can complete the rest. Good luck & Take care.

Expand|Select|Wrap|Line Numbers
  1.   INSERT INTO table_name(field1,field2,field3,field4) values ('value1','value2','value3','value4') 
  2.  
thanks!...
but ill tried that before...
want the value1 to value4 will vary, can i do this.

INSERT INTO table_name(field1,field2,field3,field4) values ('value1.text','value2.text','value3.text','value4 .text')

thank you!
julius
Dec 28 '06 #3

sashi
Expert 100+
P: 1,754
thanks!...
but ill tried that before...
want the value1 to value4 will vary, can i do this.

INSERT INTO table_name(field1,field2,field3,field4) values ('value1.text','value2.text','value3.text','value4 .text')

thank you!
julius
Hi there,

Kindly refer to below modified SQL statement, hope it helps. Good luck & Take care.

Expand|Select|Wrap|Line Numbers
  1. INSERT INTO table_name(field1,field2,field3,field4) values ('" & "Value1.Text" & "','" & "Value2.Text" & "','" & "Value3.Text" & "','" & "Value4.Text" & "') 
  2.  
Dec 28 '06 #4

NeoPa
Expert Mod 15k+
P: 31,186
From the information available you need something like :
Expand|Select|Wrap|Line Numbers
  1. INSERT INTO DestTable
  2.   (fldIDNUM,
  3.    fldDATE,
  4.    fldTIME,
  5.    [Name],
  6.    Position,
  7.    ShiftCode,
  8.    [Line],
  9.    UpdatingOfficer)
  10. SELECT
  11.    Text1,
  12.    tim3,
  13.    [Time],
  14.    Text2,
  15.    Text3,
  16.    Text4,
  17.    Text5,
  18.    Text6
  19. FROM Table1
Dec 28 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.