|
-
Jul 20th, 2000, 09:48 AM
#1
Thread Starter
Hyperactive Member
Thanks for your input, I can see what you are trying to do and decided to try and implement your code into what I have already.
There are 81 fields in the record. but sometimes the very last field No81 is empty. heres how I added your code to the existing:
Dim rsTemp As Recordset
'(your other Dims here)
Do Until rsreelstore.EOF
Set rsTemp = reeldata_db.OpenRecordset _
("SELECT COUNT(*) As RecCount " _
& "FROM reeldata WHERE Number = '" _
& rsreelstore!Number & "'")
If rsTemp!RecCount = 0 Then
Dim Fld As Field
Dim StrSQL As String
StrSQL = ""
For Each Fld In rsreelstore.Fields
If StrSQL <> "" Then StrSQL = StrSQL & ", "
StrSQL = StrSQL & Fld.Value
Next Fld
Debug.Print StrSQL
StrSQL = "INSERT INTO reeldata VALUES(" & StrSQL & ")"
reeldata_db.Execute StrSQL
End If
rsreelstore.MoveNext
Loop
when I run the code I get an error message
syntax error (missing operator) in querie expresion '8130'
err num 3075
I tried doing this:
StrSQL = "INSERT INTO reeldata VALUES('" & StrSQL & "')"
adding the ' ' around bit above but then I get
number of querie values and destination fields aren't the same.
I don't understand whats going on, is it something to do with the last field being empty. When I do a debug print of strsql string I get this at the end ie field 80 & 81
,0,
the 0 is field 80 and the blank after the coma is field 81
I have tried adding an other coma to the end but it still wouldn't work. Any idea's
Many thanks
Locutus
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
|