Problems with SQL Insert command called from VB 
Author Message
 Problems with SQL Insert command called from VB

I've Been problems using the SQL Insert command from VB.

The line I've been using is:

Insert Into users (user) Values('A')

Just to keep it simple.
What I've found is that this exact same querry works when called from
access, but when I call it from VB I get a syntax error.
(The problem actually applies to Update as well, but not Select or Delete)

I have created another table in the same database with only a single text
field and then the Insert statement worked fine.
The other table that I'm trying to append to has two fields:

userid    -> AutoNumber
user -> Text

Do I have to specify somewhere that the engine should be incrementing the
userid field from VB?

Thanks for any help that can be provided.

--
Posted from dnsmx1rrc.telcordia.com [128.96.20.41]
via Mailgate.ORG Server - http://www.*-*-*.com/



Wed, 12 Nov 2003 00:06:17 GMT  
 Problems with SQL Insert command called from VB
If you use Insert Into, you must Insert something Into every field in your
table.
Opening a recordset and AddNew or changing values is more userfriendly for
the programmer, and the Update the Recordset.

Morten


Quote:
> I've Been problems using the SQL Insert command from VB.

> The line I've been using is:

> Insert Into users (user) Values('A')

> Just to keep it simple.
> What I've found is that this exact same querry works when called from
> access, but when I call it from VB I get a syntax error.
> (The problem actually applies to Update as well, but not Select or Delete)

> I have created another table in the same database with only a single text
> field and then the Insert statement worked fine.
> The other table that I'm trying to append to has two fields:

> userid    -> AutoNumber
> user -> Text

> Do I have to specify somewhere that the engine should be incrementing the
> userid field from VB?

> Thanks for any help that can be provided.

> --
> Posted from dnsmx1rrc.telcordia.com [128.96.20.41]
> via Mailgate.ORG Server - http://www.Mailgate.ORG



Wed, 12 Nov 2003 07:31:15 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Inserting data into mutliple tables using SQL Insert Command

2. Command Object SQL Insert problem

3. MS SQL + VB.NET + INSERT command

4. VB Problem inserting into SQL-Server

5. Problems inserting hebrew words in SQL SERVER using VB 6

6. INSERT INTO SQL command

7. How to Avoid the MsgBox When Using SQL Insert Into Command

8. sql insert command double with comma

9. SQL command : INSERT INTO .....

10. Insert command(VB6 , Oracle SQL)

11. Sending a Insert or Update command to SQL-Server from Excel

12. Insert command(VB6 , Oracle SQL)

 

 
Powered by phpBB® Forum Software