Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
First time user of SQLCONNECT()
Message
From
11/06/2003 03:56:25
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
11/06/2003 00:51:11
Edward See
Magicalogic Consultancy System
Quezon, Philippines
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00798746
Message ID:
00798784
Views:
19
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform