Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
First time user of SQLCONNECT()
Message
De
11/06/2003 03:56:25
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
11/06/2003 00:51:11
Edward See
Magicalogic Consultancy System
Quezon, Philippines
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00798746
Message ID:
00798784
Vues:
20
>i have a Sample.DBC in W2K server.
>ODBC is mapped to this. DNS name is 'Sample'
>
>code inside form.init() is :
>
>nConn = SQLCONNECT('Sample','','')
>SQLEXEC(nConn,'SELECT * FROM customer','customercursor')
>
>the above works fine if form is compiled to exe and run from server.
>
>but if the same exe is run from a workstation ( directory of exe is mapped to a drive ) , nConn is error.
>
>what I am trying to do is running VFP exe but the data is hidden but accessed through server ODBC ?
>
>please guide me.
>
>thanks

Use a connection string instead. ie:
lcDBCFullpath = "\\servername\sharename\extrapath\testdata.dbc"
lcConStr="DSN=Visual FoxPro Database;"+;
    "SourceDB="+lcDBCFullpath+";"+;
    "SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;"+;
    "Collate=Machine;"
lnHandle = SQLStringConnect(lcConStr)     
SQLExec(lnHandle, "select * from customer","crsResult")
SQLDisconnect(lnHandle)
If you put the data on an NT server directory with 'list directory contents' disabled for users you can almost hide it. For further control you might use winapi to log a special user with RW rights instead of just blocking dir listing.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform