Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create table using btrieve file 1

Status
Not open for further replies.

Massimo1

Technical User
May 2, 2001
3
0
0
US
I'm trying to create a table from Pervasive Control Center's 'Execute SQL Query' using this syntax:

create table using c:\pvsw\samples\sample.btr;

..but I get this syntax error:

ODBC Error: SQLSTATE = 37000, Native error code = 0
Syntax Error: create table using<< ??? >> c:\pvsw\samples\sample.btr;
Driver not capable.

I'm running Pervasive 2000 SP3, which seems to support this syntax, so what's going wrong?
 
maybe some simple or double quote around the string c:\...
 
Thanks for responding, stefes007. I tried the quotes, but still get the same result, although I didn't get the 'driver not capable' message so it's progress of a sort:

ODBC Error: SQLSTATE = 37000, Native error code = 0
Syntax Error: create table using<< ??? >> 'c:\pvsw\samples\sample.btr';
 
The btr. file in this directory is just a data file not
a SQL database. No ddf files exist for this one.
You need to connect to the existing database first and then
use your SQL statment. In PCC click on DemoData and run
SQL DM. Only now you can use this sintax to clone the table.
 
You can't just specify the file name. The Create Table syntax looks like this:
create table using c:\pvsw\samples\sample.btr
(<fieldname> <datatype>,
<more field defintions>)
So for example, if you have a table with a 10 byte string, followed by a 90 byte string called test.btr, the create table would be:
create table using 'c:\pvsw\samples\test.btr'
(
Field1 char(10),
Field2 char(90)
)
 
Mirtheil: you're right. I did it this way and SUCCESS! It's a bit of a pain having to specify all the field lengths, but it seems to be necessary. Many thanks to everyone who responded.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top