Help: Only INSERT Does not work for ODBC connection setup to VFP database

Help: Only INSERT Does not work for ODBC connection setup to VFP database

Post by Microsoft News Grou » Wed, 08 Aug 2001 04:47:28



Hi,

I am using VB to interface with my VFP database, using ODBC. I am using DAO
3.5.

I can setup the connection to the database successfully, I can query it
successfully, I can even update/delete records from the table. But I am
unable to insert into the table. My table has several fields but none of
them HAVE to be filled up. e.g.

When I pass the command

qry="INSERT INTO SOILTIN (ID) VALUES (8);"
odbc.execute qry

I get the error - 3146 - ODBC call failed.

When I run the same command from the VFP command window it excutes
successfully.

Can anyone please tell me what I am doing wrong???

Thanks
Kiran

 
 
 

Help: Only INSERT Does not work for ODBC connection setup to VFP database

Post by Trey Walpol » Wed, 08 Aug 2001 08:51:11


Is that all the error you get back? Ouch.
Can you hit the Errors collection to see if there's more info?

Is there a primary or candidate key on that field, so that 8 is already in
there for ID?
Does every insert fail?

I don't know how DAO works, so I'll ask -- is the ";" required at the end,
or does it pass the SQL command as-is to the database?
If it passes it through as-is, the ";" may give a problem, since it's the
line continuation symbol in VFP.
If not, then ignore what I just said < g >

--
Please respond to the newsgroup so that all may benefit from the discussion.


Quote:> Hi,

> I am using VB to interface with my VFP database, using ODBC. I am using
DAO
> 3.5.

> I can setup the connection to the database successfully, I can query it
> successfully, I can even update/delete records from the table. But I am
> unable to insert into the table. My table has several fields but none of
> them HAVE to be filled up. e.g.

> When I pass the command

> qry="INSERT INTO SOILTIN (ID) VALUES (8);"
> odbc.execute qry

> I get the error - 3146 - ODBC call failed.

> When I run the same command from the VFP command window it excutes
> successfully.

> Can anyone please tell me what I am doing wrong???

> Thanks
> Kiran


 
 
 

1. HELP! SQL Setup not working

Problem: We are using ACCESS 97 with SR1 connected via ODBC to a SQL Server
6.5 database. Out .MDB code works fine on site using Access 97 but when
placed on site using Access 97 with SR1 the tables, the linked ones on the
SQL server as well as the local ones in out .MDB code all appear to be
non-updateable. If they have data in them they are alright, if the tables
are empty then you can not insert records into the database. We access the
tables directly through the tables window by selecting open.--
Steve Jenkins

2. I needs CREATE CUBE for VC++ statement code snipets

3. VFP 3.0: My *.EXE does not work ---------------- please help

4. Chat: SQL Server Replication

5. ODBC Connection Not Working

6. VFP: LostFocus and Valid Methods

7. ODBC connection works with apps but not with ASP

8. OLEDB Persistance Error

9. ODBC connection that works in IDC and not in ASP

10. ODBC connection to Local Interbase not working

11. JDBC : ODBC Connection Works on one machine but not the other

12. ODBC Database not included in Setup program...