Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing a DSN on a LAN server via ADO
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00475091
Message ID:
00475353
Vues:
34
You wrote:
<< >For a file DSN, just specify the path to the file.>>

Erik,

Do you have an example of the syntax for this? I assumed that, since the ODBC DSN was configured on the server, that the client would only need to provide the server name and the DNS in the connection string. I have been experimenting with various configurations of this, such as:

ox = createobject('adolib.vfpado')
ors = createobject("ADODB.Recordset")
sql = "Select * from codelist"
lcConn = "DSN=codelist; remote server=bob"

ox.SetInitialConnection(lcConn)

ors = ox.GetRecordSet(sql)

Do While !(ors.EOF)
ors.fields("fid").value = "BX"
ors.movenext
Enddo

I have tried several variations on this theme, all without success. Those that do compile successfully bomb out at runtime (at line "
ors = ox.GetRecordSet(sql)") with the message "ors is not an object".

I even tried a similar RDS solution with the same results.

Thanks


>>Has anyone run across how to set up an ADO connection to a DSN (or OLE DB Provider) living on a LAN server? I have been able to get ADO working on an ODBC or OLE DB on my local machine, but not on the LAN server.
>>
>>Thanks
>
>For an OLEDB provider, the string depends on the provider- if the source is file based, you need to simple specify the path in a resolvable format. For server peoviders, the same applies, but the host machine needs to be given in a resolvable format (UNC or IP Address).
>
>For a file DSN, just specify the path to the file.
>
>Perhaps if you could give more specific details as to what you need to do, I might be able to give more specifics.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform