Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO 2.6 breaks VFP ADO code
Message
De
28/09/2000 09:43:08
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
ADO 2.6 breaks VFP ADO code
Divers
Thread ID:
00421993
Message ID:
00421993
Vues:
37
I have been trying to get VFP code to store and retrieve picture files via ADO and the SQLOLEDB.1 provider. My lack of success prompted me to try downloading the MDAC 2.6. After this I could not even open a connection. Rolling back the MDAC 2.6 update allowed me to open connections once again.

Does anyone have successful code to upload to an Image field? The following code gives the bizarre error message "Property VALUE not found" on the line "oTempRecSet.fields("PICTURE").value = oStream.Read".

odbcservername="SERVER"
odbcusername="username"
loginpass="password"
oConnection = CreateObject("adodb.connection")
oConnection.ConnectionString="PROVIDER=SQLOLEDB;SERVER="+trim(odbcservername)+";DATABASE=DDHELP;UID="+trim(odbcusername)+";PWD="+trim(loginpass)+";"
oConnection.Open()
elog=""
For Each Error In oConnection.Errors
elog=elog+Error.Description+transform(Error.Number)+chr(13)+chr(10)
Next Error
if ""<>elog
messagebox(elog)
endif
oStream = CreateObject("ADODB.Stream")
oStream.type = 1 && adtypebinary
oStream.Open()
oStream.LoadFromFile("c:\picture")
oTempRecSet = CreateObject("adodb.recordset")
oTempRecSet.ActiveConnection = oConnection
oTempRecSet.Open("SELECT CLIENT_KEY, PICTURE FROM CLIENTS WHERE LNAME = 'Crandall '", , 1, 3)
oTempRecSet.fields("PICTURE").value = oStream.Read
oTempRecSet.Update
elog=""
For Each Error In oTempRecSet.Errors
elog=elog+Error.Description+transform(Error.Number)+chr(13)+chr(10)
Next Error
if ""<>elog
messagebox(elog)
endif
oConnection.Close()
oConnection = ""
Randy Hersom
President, Habilitation Software Inc.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform