Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Opening a Microsoft Visual Foxpro table via ODBC in a TFDTable component



Permlink Replies: 2 - Last Post: Nov 8, 2015 11:42 PM Last Post By: Jan Dijkstra
Jan Dijkstra

Posts: 206
Registered: 11/4/99
Opening a Microsoft Visual Foxpro table via ODBC in a TFDTable component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 6, 2015 5:57 AM
I've used the FireDAC Explorer to define a connection, using driver ID ODBC, to connect to a Microsoft Visual Foxpro database. This ODBC connection is defined as an ODBC32 system DSN, using Microsoft's Visual FoxPro ODBC driver.

On a form, I've placed a TFDConnection component, and configured it to connect to the above connection. I flip Active to true. This works.

Next, I've placed a TFDTable component on the same form, and set it's Connection property to the connection component above. No problem.
Next I assign a table to the TableName property. In the drop down list, I see all the tables that are present in the visual foxpro database, so
obviously, the connection works. I select the table I want to browse/access. This works. The object inspector even shows me the correct field name for the primary key index in the IndexFieldNames property.

Now I set the Active property of the TFDable to true. And here is where things go wrong.

Instead of changing it's state to active, it gives me an error. Specifically: "Could not convert variant of type (Null) into type (Integer)", and the Active property remains false after I click <ok> in the message box.

Now for the fun part. When I try it again, I get a different error. Specifically: "[FireDAC][DatS]-2. Object [Deleted()] is not found.". And this error is repeated each time I try to set the table's Active property to true. Until I set the Active property of the connection component to false and back to true again. Then it starts again with the first error.

I'm kind of at a loss what is wrong here because, in the FireDAC Explorer itself, I can open and browse the same table without any problems.
John MacDonald

Posts: 179
Registered: 3/22/98
Re: Opening a Microsoft Visual Foxpro table via ODBC in a TFDTable component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 7, 2015 8:49 AM   in response to: Jan Dijkstra in response to: Jan Dijkstra
Hello Jan:

I think you might remember that I too am in the middle of migrating away from the BDE and I am planning to move to Firedac. In the short term I've been having my own ( although not as serious as yours ) issues with firedac.

I wish I had your solution. I remember we should be able to look into the source code. Perhaps this is where someone might be able to help.
I have not tried to look into the source, but, I believe that I have a version that will let us see a bit more.

Is this something you have tried? Are you interested?

Maybe someone else can jump in here....

I will take a look around some of the code, although, I must admit I do most of my work in C++.
It's been a very long time since I took a look at Delphi.

Good luck

John

Jan Dijkstra wrote:
I've used the FireDAC Explorer to define a connection, using driver ID ODBC, to connect to a Microsoft Visual Foxpro database. This ODBC connection is defined as an ODBC32 system DSN, using Microsoft's Visual FoxPro ODBC driver.

On a form, I've placed a TFDConnection component, and configured it to connect to the above connection. I flip Active to true. This works.

Next, I've placed a TFDTable component on the same form, and set it's Connection property to the connection component above. No problem.
Next I assign a table to the TableName property. In the drop down list, I see all the tables that are present in the visual foxpro database, so
obviously, the connection works. I select the table I want to browse/access. This works. The object inspector even shows me the correct field name for the primary key index in the IndexFieldNames property.

Now I set the Active property of the TFDable to true. And here is where things go wrong.

Instead of changing it's state to active, it gives me an error. Specifically: "Could not convert variant of type (Null) into type (Integer)", and the Active property remains false after I click <ok> in the message box.

Now for the fun part. When I try it again, I get a different error. Specifically: "[FireDAC][DatS]-2. Object [Deleted()] is not found.". And this error is repeated each time I try to set the table's Active property to true. Until I set the Active property of the connection component to false and back to true again. Then it starts again with the first error.

I'm kind of at a loss what is wrong here because, in the FireDAC Explorer itself, I can open and browse the same table without any problems.

--
JMAC out
Jan Dijkstra

Posts: 206
Registered: 11/4/99
Re: Opening a Microsoft Visual Foxpro table via ODBC in a TFDTable component
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 8, 2015 11:42 PM   in response to: John MacDonald in response to: John MacDonald
John MacDonald wrote:
Hello Jan:

I think you might remember that I too am in the middle of migrating away from the BDE and I am planning to move to Firedac. In the short term I've been having my own ( although not as serious as yours ) issues with firedac.

I wish I had your solution. I remember we should be able to look into the source code. Perhaps this is where someone might be able to help.
I have not tried to look into the source, but, I believe that I have a version that will let us see a bit more.

Is this something you have tried? Are you interested?

Maybe someone else can jump in here....

I will take a look around some of the code, although, I must admit I do most of my work in C++.
It's been a very long time since I took a look at Delphi.

Good luck

John

Well, I assume the first error I get (the one for the cannot convert ...) is not an expected error, as it pops up in the same sort of message box you get when the IDE itself crashes fatally. The one where it collects a lot of information and send a crash report.

I also assume I must be doing something wrong with either setting the properties of the TFDTable, the TFDConnection or both, since the table is perfectly browseable in the FireDAC Explorer itself. I just don't know what I'm missing here.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02