problem with INSERT statement in VB

problem with INSERT statement in VB

Post by Chris Katsifol » Thu, 11 Mar 1999 04:00:00


I've set up two computers that talk to each other via winsock
controls. Computer A sends computer B an Insert SQL statement, which
computer B executes (thus inserting data into the database)

The problem is, every now and then (once every few dozen statements)
I get a run time error on computer B (the one receiving the Insert SQL
strings and executing them) which reads "Missing semi colon"

Am I supposed to have a semi-colon somewhere in the Insert statement?
Can anyone shed some light?




1. Problem Inserting batch insert statement


I am using SQL7 and ADo 2.5. I am trying to pass sql statment
consisting 500 or more insert statements. But surprisingly ADO with
default ole-db provider for odbc driver allows to insert 455 maximum
records. It works fine with sqloledb provider. Here is the code that
uses employee table in pubs database.

Dim i As Integer
Dim sqlStmt As String
Dim conn As ADODB.Connection

    Set conn = CreateObject("ADODB.Connection")
    conn.ConnectionTimeout = 0
    conn.CommandTimeout = 0
    'This does not insert more than 455 records
    'conn.Open "driver={SQL
    'This works
    conn.Open "Provider=SQLOLEDB;Data Source=(local);Initial

    For i = 1 To 500
    sqlStmt = sqlStmt & "INSERT INTO employee1  (emp_id,   fname,  
minit," & _
   "lname ) VALUES  (" & "'emp" & CStr(i) & "','fname','M','LNAME' )
;" & vbCrLf
    Next i
    conn.Execute sqlStmt


2. _RecordPtr->Release causing R6025 ? How do I free my memory?

3. Date to SQL from VB using Insert statement

4. Can help with programming. Urgently need some work

5. VB to Access Insert Statement (counter field)

6. Refreshing the ADO data control

7. Oracle 8, ODBC, VB 5.0 problem, insert problem:

8. grab the time out of a smalldatetime

9. Problem with SQL (INSERT-statement)

10. Problem with an insert statement

11. Problem with simple INSERT statement in 7.0

12. INSERT statement problem in Transactions

13. Problem with IDENTITY and ORDER BY in a INSERT statement