Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
First time user of SQLCONNECT()
Message
 
À
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:
00798771
Vues:
23
This message has been marked as the solution to the initial question of the thread.
Make a DSN in you client too.

to create a runtime DSN
local m_x

declare integer SQLConfigDataSource in odbccp32.dll integer,integer,string,string
tcDSN='YourDSNName'
tcPath='X:\DataDirectory'

lcType='Microsoft Visual FoxPro Driver'
lcODBC='DSN='+alltrim(tcDSN)+chr(0)+;
'Description='+alltrim(tcDSN)+chr(0)+;
'SourceDB='+alltrim(tcPath)+chr(0)+;
'SourceType=DBC'


SQLConfigDataSource(0,3,lcType,lcODBC)
m_x=SQLConfigDataSource(0,1,lcType,lcODBC)

if m_x=0
return .t.
else
return .f.
endif

This example is to create a ODBC DSN to a VFP Data source. 
>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
--
--
Aashish Sharma
Tele Nos: +1-201-490-5405
Mobile: +91-9821053938
E-Mail:
aashish@aashishsharma.com
write2aashish@gmail.com

You better believe in yourself... if you don't, who else will ?
TODAY is a gift, that's why it's called PRESENT
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform