|
-
Dec 11th, 2001, 11:05 AM
#1
Thread Starter
Fanatic Member
why is my "insert" not inserting!!
Im trying to insert a simple line of text into fields in my table.
How come the data in my text file is not inserting into my table. VB brings up no errors & looks like it has worked but when i go into my table there is nothing there. Is there any way i can manually hard code data to see it work?heres my code..
'Open the text file
Set ts = fso.OpenTextFile("c:\windows\desktop\10010253136471.txt")
'Open the table
rst.Open "SELECT * FROM tbl_headerrecord", cn, adOpenDynamic, adLockOptimistic
'If RecordCount = 0 Then
If rst.EOF Then
strsql = "INSERT INTO tbl_headerrecord (recordid,acno)" & _
"," & "VALUES (" & str_recordid & "," & int_acno & ")"
Else
strsql = "UPDATE tbl_headerrecord SET recordid=" & str_recordid & ",acno=" & int_acno & ")"
cn.Execute strsql
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|