Open Access in COM. Help!

Results 1 to 4 of 4

Thread: Open Access in COM. Help!

  1. #1
    Michael W. Guest

    Default Open Access in COM. Help!

    Okay, small problem, and any help would be greatly appriciated.<BR>I&#039m working on a COM object that is supposed to open up an access database, go through 5000 or so records (client won&#039t let us use Oracle), pull out a set of record in a SQL code, and bring up around 20 different statistics on these records. I figured it&#039s better that I do this in a COM object then ASP. Does anybody have any code that will help me open this Access database in the COM object? Thanks for any help!

  2. #2
    Join Date
    Dec 1969

    Default RE: Open Access in COM. Help! it like you would with asp. Just make sure your VB project has references to the ADODB components.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default One more thing

    server.createobject isn&#039t available (you may or may not be in the web server process) <BR><BR>I do believe its just: <BR><BR>set obj = CreateObject("OBJ.IdString")

  4. #4
    Jerry E Guest

    Default RE: Open Access in COM. Help!

    Your com object can be :<BR>Public Function ReturnData()<BR> Dim Conn As New ADODB.Connection<BR> Dim RS As New ADODB.Recordset<BR> Dim lvsql, lvresult As String<BR> Conn.Open "dsn=???;uid=???;pwd=???" - check for access (ODBC)<BR> lvsql = "select fld1, fld2 from table"<BR> Set RS = Conn.Execute(lvsql)<BR> lvresult = ""<BR> &#039do whatever you want in this loop<BR> Do Until RS.EOF<BR> lvresult = lvresult & "fld1=" & RS("fld1")<BR> RS.MoveNext<BR>Loop<BR>Conn.Close<BR>ReturnData = lvresult<BR>End Function<BR>in your ASP just code :<BR>dim objTest, rvalue<BR>set objTest = Server.CreateObject("objname??.methodname??")<BR>r value = objTest2.ReturnData<BR><BR>Also, see prior note about putting ADO references in VB app.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts