Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update BackEnd form vfp.net toolkit
Message
Information générale
Forum:
ASP.NET
Catégorie:
Visual FoxPro Toolkit pour .NET
Divers
Thread ID:
00671827
Message ID:
00671840
Vues:
18
This message has been marked as the solution to the initial question of the thread.
You need to pass a select statement to the Toolkit's SQLExecute function. It then returns a filled DataView. This function is not intended to pass an Update statement. You can however, execute a store procedure which then returns a recordset to .NET. See thread 651087 to see how to do that.

>Can I update the sql backend using the vfptoolkit? I keep bombing in the following code:
>
>
>Dim iLoginCount = txtLoginCount.Text + 1
>Dim cDateTime As String
>Dim lcConnectionString As String
>Dim lcSQL As String
>Dim oConn As OleDb.OleDbConnection
>Dim docID As String
>cDateTime = VFPToolkit.dates.DateTime.ToString
>
>lcConnectionString = "provider=sqloledb.1;server=cqi-termserv;uid=ctore;pwd=cqi;database=ctore"
>docID = txtUserName.Text
>lcSQL = "Update dbo.coPer set loginCount = " & iLoginCount & ", LastLogin= '" & cDateTime & "' where coPerID=" & docID
>
>'Connect to the Database, execute the query and disconnect
>
>oConn = VFPToolkit.vfpData.SqlConnect(lcConnectionString)
>VFPToolkit.vfpData.SqlExecute(oConn, lcSQL)   <== This is the line that bombs, Cannot find table 0
>VFPToolkit.vfpData.SqlDisConnect(oConn)
>
>
>
>I also tried changing the line to:
>VFPToolkit.vfpData.SqlExecute(oConn, lcSQL, "curResults")
>
>Thanks for any help
>
>Kirk
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform