Help required with cfront and asp

sbhamidisbhamidi Member Posts: 22
edited 2010-03-04 in Navision Attain
I'm trying to incorporate Cfront into an asp page. I've been able to retrieve records using Visual Basic. But in VBscript/ASP, I've been facing this issue.
=======================
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'OpenTable'
/Project3/TestConn.asp, line 63
=======================

The VBscript code is as follows:
dim NaviPath,flfPath,dbPath,coName,dbUser,tableNo,hRec
dim curRow,cf
dim tableRef 
set cf = createobject("Cfront.cfrontctrl.1")
DriverName = "Andilaey"
ServerName = "DEPLOYMENT1"
NetType = "tcp"
Cachesize = 1000
UseCommitCache = 0
NTAuthentication = 0
UserID = "SUPER"
Password = ""

DbFileName = ""
NaviPath = "F:\Program Files\Navision Clients\Fin260\"
LicenseFile = NaviPath + "fin.flf"

cf.SetNavisionPath NaviPath
cf.LoadLicenseFile LicenseFile
cf.CheckLicenseFile (9110)

cf.ConnectServerAndOpenDatabase DriverName, ServerName, NetType, DbFileName, Cachesize, UseCommitCache, NTAuthentication, UserID, Password
CompanyName = "Test Web"
cf.OpenCompany CompanyName
tableRef = clng(tableRef)
tableNo = clng(tableNo)
tableNo = 50016
cf.OpenTable tableRef,tableNo
'This above line is line 63
' NOT DOING ANYTHING AFTER OPENING TABLE BECAUSE ONLY A TEST
cf.CloseTable tableRef
cf.CloseCompany
cf.CloseDatabase

This approach works correctly in Visual Basic. The only thing missing in VBscript is the inability to declare variable "tableRef" as Long. So I tried using CLng() function to convert it that way. It hasn't helped.
Can anyone please help?
Thanks in advance

Comments

  • sbraninsbranin Member Posts: 18
    Have you found the solution to this problem?

    -Steve
  • FrontierFrontier Member Posts: 2
    If anyone has found a solution to this, I'd really like to hear it as well... ](*,)
Sign In or Register to comment.