Walker Boh


Hello everybody,

I created a table with an autoincrement field(
CREATE TABLE `Synch_LogFile` (
`ID` I Autoinc NOT NULL,
`TableName` C (100) NOT NULL,
...)
)

when I try To open it by ADO with VB (Select * From Synch_LogFile) I get this error message: [Microsoft][ODBC Visual FoxPro Driver]Not a table.

What's I'm doing wrong

Thanks,





Re: Dbf Autoincrement with ADO

Alex Feldstein


You are using the old ODBC driver which dates back to VFP version 6. It does not understand newer types as incremental fields which came out in later versions.

Your only choice here is to use the newer OLEdb Provider as the ODBC Driver has not been updated.

You can download it here.






Re: Dbf Autoincrement with ADO

Walker Boh

I downloaded and installed, but I already had the version 6 of the driver.

Now I tried 2 things:

1) with this connection string (Provider=MSDASQL.1;Persist Security Info=False;Data Source=Arca) I still got the message "[Microsoft][ODBC Visual FoxPro Driver]Not a table."

2) with ththis connection string (Provider=VFPOLEDB.1;Data Source=C:\Programmi\Microsoft Visual FoxPro OLE DB Provider\Samples\Northwind\northwind.dbc;Password="""";Collating Sequence=MACHINE) I can open the table, bat I can't update it.







Re: Dbf Autoincrement with ADO

Alex Feldstein

1) it will not work with ODBC and newer table capabilities such as autoincrenent fields as I said. On top of that you are invoking MSASQL and nto VFO ODBC Driver

2) Should work with OleDb Provider. What is your code to update What is the failure error message Remember you cannot/should not write to the autoinc field as it fills automatically. Also remember to provide values for any columns with NOT NULL accepted and no default values defined.





Re: Dbf Autoincrement with ADO

Walker Boh

Dim cn As New ADODB.Connection
cn.Open "Provider=VFPOLEDB.1;Data Source=C:\Programmi\Microsoft Visual FoxPro OLE DB Provider\Samples\Northwind\northwind.dbc;Password="""";Collating Sequence=MACHINE"
Dim rs As New ADODB.Recordset
rs.Open "Select * from Categories", cn, adOpenForwardOnly, adLockOptimistic
rs.AddNew

and I got the error:

Runtime error 3251
recordset doesn't support update. It could be a limit of the provider or of the lock type selected

(well, it is my translation, I actually have the message in Italian)

Thanks for your patience






Re: Dbf Autoincrement with ADO

Alex Feldstein

You are opening as adOpenForwardOnly client cursor, not server cursor which expects to work in disconnected mode at the client side.

If you are a VFP developer and are a little unfamiliar with the old ADO, maybe this old article can help as it contains code samples and info on how to use it (at least from VFP). There are a probably many other sites that show you old VB 6.0 code samples too.

http://msdn2.microsoft.com/en-us/library/ms917355.aspx





Re: Dbf Autoincrement with ADO

dni

May be you experience transmission errors and file becames corrupt in transit.

Do you have a connection pooling enabled






Re: Dbf Autoincrement with ADO

Walker Boh

I tried every combination of CursorLocation, CursorType and LockType, but the AddNew isn't still working.

I can't either link the table in Access: I got the same weird error (Not a Table)






Re: Dbf Autoincrement with ADO

dni

You may try to disable connection pooling.




Re: Dbf Autoincrement with ADO

Walker Boh

I don't use connection pooling




Re: Dbf Autoincrement with ADO

dni

Connection pooling is activated automated when you connect.You may disable it with OLE DB Services= -2 inserted in connection string (at the end).




Re: Dbf Autoincrement with ADO

Walker Boh

nothing changed




Re: Dbf Autoincrement with ADO

dni

Do you have a error number like "80040e37"

Can you post the error message in italian






Re: Dbf Autoincrement with ADO

Walker Boh

Runtime error 3251
recordset doesn't support update. It could be a limit of the provider or of the lock type selected

Runtime error 3251
Il set di record corrente non supporta l'aggiornamento. Potrebbe trattarsi di una limitazione del provider o del tipo di blocco selezionato

(Are you Italian )






Re: Dbf Autoincrement with ADO

dni

I am not but I know some words. It is possible to have the table opened by an other in exclusive mode