If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Creating a new FoxPro DBF with a CDX file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-13-03, 15:49
dhahn36 dhahn36 is offline
Registered User
 
Join Date: Nov 2003
Posts: 4
Creating a new FoxPro DBF with a CDX file

Hello,

I am trying to create a new FoxPro table that uses a CDX file using the FoxPro ODBC interface. I can create the table just fine using the "CREATE TABLE" command, but there is no CDX created with the table. When examining the file and referencing the format of the DBF, the byte that indicates the file has a structural CDX, byte 28, is not set to 0x01 as it would be if it had one. Is there additional syntax that needs to be included in the CREATE TABLE command to write the CDX as well?

Here is my CREATE TABLE command:
dbconn.Execute "Create Table PPOPUP (CODE char(20), SUBCODE char(20), DESCR char(50), PAGES I(1))"

Also any CDX with the same name as my dbf gets deleted when I execute the "CREATE TABLE" command.

I have tried using the "INDEX" command exposed by the ODBC driver,
but I always get a "Syntax Error or Access violation" error when doing so. Below is a sample of what I do with the INDEX command

dbconn.Execute "INDEX ON Code TAG Code"

Code is a name of the field in the table.

Can someone point me in the right direction? I have been trying to generate this CDX for two days now! It seems like such a simple thing, yet I can't get it to work! I am using VB6 SP5. Thanks!!!

Last edited by dhahn36; 11-13-03 at 17:36.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On