PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Finding the current connection for a file/table
Finding the current connection for a file/table
Débuté par Pascal Scheffers, 01 juil. 2004 15:08 - 4 réponses
Posté le 01 juillet 2004 - 15:08
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.
Posté le 01 juillet 2004 - 15:19
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.
Posté le 01 juillet 2004 - 17:12
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
Posté le 01 juillet 2004 - 21:29
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






Posté le 01 juillet 2004 - 23:06
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/