PDA

Click to See Complete Forum and Search --> : ASP AND DAO! ODBC CALL FAILED YUCKY


hozo
Oct 18th, 2000, 06:09 PM
Someone please help. I'm getting ODBC call fail on this program. When I do this via a normal EXE it workds, I can see the collection and see real values, however when I compile as a activex exe and run it I get the ODBC called failed message so is there something I'm missing?

The is DSN is RA, point ot C:\RA\Customer.MDB
no SYSTEM DB whatever that is.. no usernames or passwords are setup anywhere.

Do I need to setup a username and password maybe since the web server is calling the EXE? Does the database have to be somewhere off the WWWROOT ?

I'm using vb6, sp4, winpro2000 and acess2000... someone please help. I need to beat out the jerk in the other office :) thanks!



RA.EXE(activex) in C:\RA
--------------------
Public oRecordsSelected As New Collection
Public Function getDatabaseInfo() As String
Dim WS As Workspace
Set WS = DBEngine.CreateWorkspace( "ODBCDirect" , "Admin", "", dbUseODBC)
Dim cn As Connection
Set cn = WS.OpenConnection("RA", dbDriverNoPrompt, False)

Dim rs As Recordset
Set rs = cn.OpenRecordset("Select * from Agents", dbOpenForwardOnly)

Do Until rs.EOF
oRecordsSelected.Add rs.Fields("AgentUserName").Value
rs.MoveNext
Loop

getDatabaseInfo = oRecordsSelected.Count
End Function

ASP PAGE
------------------------
<%
set RACustomer = server.createobject("RA1.RAClass1")
RACustomer.getdatabaseinfo()
for i = 1 to RACustomer.oRecordsSelected.Count
respone.write "<TR><TD>" & RACustomer.oRecordsSelected(i) & "</TD></TR>"
next
%>

hozo
Oct 18th, 2000, 06:12 PM
oh just a correction.. the class/com is called RA/RAClass respectively.. I see I have RA1.RAClass1 in the asp.. thats' just from me trying to debug.. if you call it that.