Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
First time user of SQLCONNECT()
Message
 
À
11/06/2003 05:14:04
Edward See
Magicalogic Consultancy System
Quezon, Philippines
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00798746
Message ID:
00798863
Vues:
31
The DNS entry would have to be defined on each workstation... you are better off to use the string connection as Cetin suggests. Then there is nothing to setup on the workstation.


>Thanks Cetin, you have been most helpful in the past.
>
>the following line still somehow makes the dbc visible
>
>lcDBCFullpath = "\\servername\sharename\extrapath\testdata.dbc"
>
>i was looking if possible where only the ODBC DNS name is used since it is already defined in the server.
>
>by using SQLCONNECT('SERVER_DNS_NAME','','')
>
>without recoursing to a SqlStringConnect() but only SqlConnect()
>
>>>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
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform