PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Finding the current connection for a file/table
Finding the current connection for a file/table
Started by Pascal Scheffers, Jul., 01 2004 3:08 PM - 4 replies
Posted on July, 01 2004 - 3:08 PM
I am trying to figure out if a file is a .FIC or a MySQL or other database at runtime. Is there a function to do this? I have found HDescribeConnection, but that only seems to set/create a new connection.
- Pascal.
Posted on July, 01 2004 - 3:19 PM
Pascal
Have you tried HFileExist(filename). Check for fic, then if not exist you have a MySQL file.
John Marrone

I am trying to figure out if a file is a .FIC or a MySQL or other database at runtime. Is there a function to do this? I have found HDescribeConnection, but that only seems to set/create a new connection.
- Pascal.
Posted on July, 01 2004 - 5:12 PM
Hi Pascal,
try YourFile..Connection
HTH
Raimund
I am trying to figure out if a file is a .FIC or a MySQL or other database at runtime. Is there a function to do this? I have found HDescribeConnection, but that only seems to set/create a new connection.
- Pascal.



http://www.invitec.com
Posted on July, 01 2004 - 9:29 PM
And use :
HListConnection(hLstDetail+hLstAll+hLstSorted)

to know the properties of the connection.

Raimund Schuldhaus <rschuldhaus@invitec.com> wrote:

Hi Pascal,
try YourFile..Connection
HTH
Raimund
I am trying to figure out if a file is a .FIC or a MySQL or other database

at runtime.
>Is there a function to do this? I have found HDescribeConnection, but that
only seems
to set/create a new connection.
- Pascal.


http://www.invitec.com






Posted on July, 01 2004 - 11:06 PM
Hi Pascal,
The '..type' attribute of your file or query should do it.
Here's an example (HFNormal is HyperFile 7):
SWITCH QRY_SELECT_PRODUCT_BY_ID..Type
CASE hFileHF5:
gNumEnr=HRecNum(QRY_SELECT_PRODUCT_BY_ID)
CASE hFileNormal:
gNumEnr=HRecNum(QRY_SELECT_PRODUCT_BY_ID)
CASE hFileQuery:
gNumEnr = HSavePosition(QRY_SELECT_PRODUCT_BY_ID)
OTHER CASE :
gNumEnr=HSavePosition(QRY_SELECT_PRODUCT_BY_ID)
END
Regards,
Peter

http://members.chello.be/cr45693/