Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: ASP and Visual Foxpro


Message #1 by gbrown@c... on Fri, 11 Aug 2000 19:9:55
Hi all 



I'm new to ASP and am trying to access vfp dbc files. I can read them just 

fine but when I come to write back the update gives an error saying that 

the operation is not supported.

Vid is a key field and make is the field I want to update



I've posted the code below I'd appreciate any help anyone can give.



Kind regards

Graham Brown

gbrown@c...



clssfd.asp

<!-- METADATA TYPE="typelib"

              FILE="c:\Program Files\Common Files\System\ado\msado15.dll" 

-->

<%

  Dim objConn

  Set objConn = Server.CreateObject("ADODB.Connection")

  objConn.Open "Driver={Microsoft Visual FoxPro 

Driver};SourceType=DBC;SourceDb=C:\Fleet\database.dbc"

%>



save.asp

<!--#include file="Clssfd.asp"-->



<%

  Dim rsrbvmas

  Set rsrbvmas = Server.CreateObject("ADODB.Recordset")

  strSQL = "SELECT * FROM rbvmas where vid='" & request("ovid") &"';"



  rsrbvmas.Open strSQL,objConn



  If Not rsrbvmas.EOF Then

     rsrbvmas("MAKE")="hello"

     rsrbvmas.Update

  Else

    Response.Write "<CENTER><H2>Cannot find "&request("ovid")&" 

</H2></CENTER>"

  End If

  rsrbvmas.close

  Set rsrbvmas = Nothing

%>



Message #2 by Ali Karimi <a97alika@s...> on Sun, 13 Aug 2000 19:10:06 +0200
You probably need to set the right Cursor & Lock type.

If you don't have the right combination of these two then it will not work!



// Ali





gbrown@c... wrote:



> Hi all

>

> I'm new to ASP and am trying to access vfp dbc files. I can read them just

> fine but when I come to write back the update gives an error saying that

> the operation is not supported.

> Vid is a key field and make is the field I want to update

>

> I've posted the code below I'd appreciate any help anyone can give.

>

> Kind regards

> Graham Brown

> gbrown@c...

>

> clssfd.asp

> <!-- METADATA TYPE="typelib"

>               FILE="c:\Program Files\Common Files\System\ado\msado15.dll"

> -->

> <%

>   Dim objConn

>   Set objConn = Server.CreateObject("ADODB.Connection")

>   objConn.Open "Driver={Microsoft Visual FoxPro

> Driver};SourceType=DBC;SourceDb=C:\Fleet\database.dbc"

> %>

>

> save.asp

> <!--#include file="Clssfd.asp"-->

>

> <%

>   Dim rsrbvmas

>   Set rsrbvmas = Server.CreateObject("ADODB.Recordset")

>   strSQL = "SELECT * FROM rbvmas where vid='" & request("ovid") &"';"

>

>   rsrbvmas.Open strSQL,objConn

>

>   If Not rsrbvmas.EOF Then

>      rsrbvmas("MAKE")="hello"

>      rsrbvmas.Update

>   Else

>     Response.Write "<CENTER><H2>Cannot find "&request("ovid")&"

> </H2></CENTER>"

>   End If

>   rsrbvmas.close

>   Set rsrbvmas = Nothing

> %>

>

> ---

> You are currently subscribed to asp_databases




Message #3 by Chao Zhou <ChaoZhou@e...> on Tue, 15 Aug 2000 10:18:46 -0400
You can use a UPDATE SQL statement instead of using the Update function of

RecordSet, which gives better performance as well. It will be something

like:



strSql = "update rbvmas set MAKE='new value' where vid='" & request("ovid")

&"'"

objConn.Execute strSql





Thanks,





Chao Zhou



-----Original Message-----

From: gbrown

Sent: Thursday, August 10, 2000 8:01 PM

To: ASP Databases

Subject: [asp_databases] ASP and Visual Foxpro





Hi all 



I'm new to ASP and am trying to access vfp dbc files. I can read them just 

fine but when I come to write back the update gives an error saying that 

the operation is not supported.

Vid is a key field and make is the field I want to update



I've posted the code below I'd appreciate any help anyone can give.



Kind regards

Graham Brown

gbrown@c...



clssfd.asp

<!-- METADATA TYPE="typelib"

              FILE="c:\Program Files\Common Files\System\ado\msado15.dll" 

-->

<%

  Dim objConn

  Set objConn = Server.CreateObject("ADODB.Connection")

  objConn.Open "Driver={Microsoft Visual FoxPro 

Driver};SourceType=DBC;SourceDb=C:\Fleet\database.dbc"

%>



save.asp

<!--#include file="Clssfd.asp"-->



<%

  Dim rsrbvmas

  Set rsrbvmas = Server.CreateObject("ADODB.Recordset")

  strSQL = "SELECT * FROM rbvmas where vid='" & request("ovid") &"';"



  rsrbvmas.Open strSQL,objConn



  If Not rsrbvmas.EOF Then

     rsrbvmas("MAKE")="hello"

     rsrbvmas.Update

  Else

    Response.Write "<CENTER><H2>Cannot find "&request("ovid")&" 

</H2></CENTER>"

  End If

  rsrbvmas.close

  Set rsrbvmas = Nothing

%>





Message #4 by gbrown@c... on Mon, 21 Aug 2000 19:42:41
Thought i may as well reply to myself.



Is everyone aware that not all oledb providers support the full object 

model. dbc's require that you talk with sql commands.



I'd have expected more from visual studio but there you go



regards



gbrown@c...


  Return to Index