Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why this ADO error with javascript but not with vbscript
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Why this ADO error with javascript but not with vbscript
Miscellaneous
Thread ID:
00722031
Message ID:
00722031
Views:
80
I have run into a really frustrating error when trying to use some simple ADO capabilities with Javascript. Specifically the problem is with ADO's recordset "open" function. It has to do with how to actually call the function. Here's an example of VBscript from the KB that works fine. Note the very last command (RS.open).
   Set Conn = Server.CreateObject("ADODB.connection")
   ConnStr= "Driver=Microsoft Visual Foxpro Driver; " + _
   "UID=;SourceType=DBC;SourceDB=C:\VFP\Samples\Tastrade\Data\Tastrade.dbc"
   Conn.Open ConnStr   'This can be a datasource name or a connect string
   Set cmdTemp = Server.CreateObject("ADODB.Command")
   Set rs = Server.CreateObject("ADODB.Recordset")
   SQLText="Select Distinct Products.Product_ID,Products.Product_Name,"+ _
      "Products.English_Name,Products.Unit_Price, " + _
      "Products.Quantity_In_Unit from Tastrade!Products"
   cmdTemp.CommandText = SQLText
   cmdTemp.CommandType = 1 'SQL statement
   Set cmdTemp.ActiveConnection = Conn
   rs.CacheSize = 10
   rs.Open cmdTemp,,adopenstatic
I cannot get the rs.Open command to execute the Javascript version of the final line of code without an error trap complaining about the calling sequence. Yet I'm pretty sure that all the variables are defined and constructed correctly. For example, something like:
rs.Open(cmdTemp,,3);     // Gives an error (3=adopenstatic)
rs.Open(cmdTemp,null,3);   // Gives an error 
rs.Open(cmdTemp,"",3);  // Gives an error
rs.Open(cmdTemp,0,3);   // Gives an error
What _is_ the correct calling sequence to make the recordset Open method callable from Javascript? Thanks!
Next
Reply
Map
View

Click here to load this message in the networking platform