Information générale
Titre:
OLE DB Connection string and ADO object commands
I'm having all kinds of trouble figuring out how to install and find a basic ASP script to talk to VFP data from ASP.
here is my ASP code I'm trying to use:
lcSelectClause = "SELECT Dname from dealer"
CrownDBC_ConnectionString = "Provider=VFPOLEDB.1;Data Source=i:\crown01\crownweb.dbc"
CrownDBC_ConnectionTimeout = 15
CrownDBC_CommandTimeout = 30
CrownDBC_CursorLocation = 3
CrownDBC_RuntimeUserName = ""
CrownDBC_RuntimePassword = ""
Set MyConn = Server.CreateObject("ADODB.Connection")
MyConn.ConnectionTimeout = CrownDBC_ConnectionTimeout
MyConn.CommandTimeout = CrownDBC_CommandTimeout
MyConn.Open CrownDBC_ConnectionString, CrownDBC_RuntimeUserName, CrownDBC_RuntimePassword
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set dataset = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = lcSelectClause
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = MyConn
dataset.Open cmdTemp, , 1, 3
I'm getting an error on the "Set CmTemp.ActiveConnection = MyConn". I assume this means that the vfpoledb provider is available or it would have errored on the MyConn.Open command.
I've used this ADO structure with ODBC for about five years now without any problems so it's kind of rough now going back in and trying to do it a new way.
Any help is MUCH appreciated!
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement