Easysoft XML-ODBC Server

How do I access ODBC databases from an ASP running under IIS with XML?

Article:
00950
Last Reviewed:
24th January 2024
Revision:
1

Use the Easysoft XML-ODBC Server to access ODBC databases from an Active Server Page (ASP) on Internet Information Server (IIS).

Register with us now to download a fully functional free trial version of the Easysoft XML-ODBC Server.

To use XML to access ODBC databases from an ASP running under IIS:

  1. Install the Easysoft XML-ODBC Server and create a System ODBC data source for the target database. Test that you can access the data source with one of the XML-ODBC Server sample clients included in the distribution.

    For information about how to do this, see the Easysoft XML-ODBC Server documentation.

  2. Copy xmlodbc.dll from InstallDir/XML-ODBC Server/Clients/VB on the machine running the Easysoft XML-ODBC Server to your Windows System32 directory.

    Replace InstallDir with the Easysoft XML-ODBC Server installation directory, by default, /Program Files/Easysoft.

  3. At the MS-DOS prompt, register xmlodbc.dll:
    regsvr32 %WINDIR%\System32\xmlodbc.dll

    To get help with registering DLLs, type:

    regsvr32
  4. Create a file named xmldemo.asp under the IIS WWWRoot directory:
    <%
    set xmlODBC=Server.CreateObject("Easysoft_XML_ODBC.xmlODBC")
    
    xmlODBC.Server = "my_xml_server_hostname"
    xmlODBC.Port = 8895
    txtDSN = "DSN=my_system_dsn"
    txtSQL = "select * from my_table"
    
    If Not xmlODBC.Connect Then
        response.write "Connect Error : " & xmlODBC.ErrorState _
            & " : " & xmlODBC.ErrorText
    End If
    
    xmlODBC.Execute txtSQL, txtDSN
    If Len(xmlODBC.RawData) < 1 Then
        response.write "SQL Error : " xmlODBC.ErrorState _
            & " : " & xmlODBC.ErrorText
    End If
    
    response.write xmlODBC.RawData
    xmlODBC.Disconnect
    %>
    

    Replace my_xml_server_hostname with the name of the machine on which the XML-ODBC Server is running. Replace my_system_dsn with the name of your System data source on the XML-ODBC Server machine. Replace the txtSQL value with a valid SQL statement.

    For more information about the properties, collections and methods that xmlodbc.dll contains, see InstallDir/XML-ODBC Server/Clients/VB/README.txt.

Applies To

Knowledge Base Feedback

* Did this content help you?
* Please select one option based on your first choice:

(* Required Fields)