ASP vs VB code

Results 1 to 3 of 3

Thread: ASP vs VB code

  1. #1
    Matiur Rahman Guest

    Default ASP vs VB code

    I am trying to connect an Oracle Database from ASP using a DSN created with Oracle ODBC driver. The connection string is:<BR> &#060;--<BR> "dsn=OraHub2K;uid=app735am01;pwd=735dd;"<BR> --&#062;<BR><BR>While this code works from a VB client, IT DOES NOT WORK FROM ASP runing on NT with PWS. It generates the following error:<BR><BR>&#060;---<BR>There was an error <BR>-2147467259<BR>[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified<BR>---&#062;<BR>I don&#039t understand what the problem is. Why is it looking for Microsoft ODBC Driver Manager? I am using Oracle ODBC Driver.<BR>DSN name was found in the registry.<BR><BR>Is ADO in ASP behaves differently than in VB? Has anybody had this problem? I can connect DB without DSN (DSN_less connection). That works from ASP. But our client requires that we use DSN instead.<BR><BR>Please help to resolve this problem. Thanks<BR><BR>Note: Below is the actual code if you want to look at...<BR><BR><BR>Visual Basic Code<BR>&#060;--Private Sub Command1_Click()<BR> Dim obj As UPSDATA.ConnectOracle<BR> Dim strSQL As String<BR> Dim rs As ADODB.Recordset<BR> Set rs = New ADODB.Recordset<BR> <BR> strSQL = "SELECT * FROM V_LATEST_SORT_DATE"<BR> <BR> Set obj = New UPSDATA.ConnectOracle<BR> obj.ConString = "dsn=OraHub2K;uid=app735am01;pwd=735dd;"<BR> <BR> Set rs = obj.GetSQLReturnRS(strSQL)<BR> <BR> MsgBox "Latest Sort Date= " & rs(0)<BR> <BR>End Sub<BR>---&#062;<BR><BR>ASP Code<BR>&#060;---Private Sub ProcessPage2()<BR> <BR> Dim obj <BR> Dim strSQL <BR> Dim rs <BR> Set rs = Server.CreateObject("ADODB.Recordset")<BR> <BR> strSQL = "SELECT * FROM V_LATEST_SORT_DATE"<BR> <BR> set obj=server.CreateObject("UPSDATA.ConnectOracle")<B R> <BR> obj.ConString = "dsn=OraHub2K;uid=app735am01;pwd=735dd;"<BR> on error resume next<BR> Set rs = obj.GetSQLReturnRS(strSQL)<BR> <BR> if (err.number&#060;&#062;0) then<BR> Response.Write "<BR>" & "There was an error " & "<BR>"<BR> Response.Write err.Number & "<BR>"<BR> Response.Write err.Description<BR> else<BR> Response.write "Latest Sort Date= " & rs(0)<BR> end if<BR> <BR> <BR>End Sub<BR>--&#062;

  2. #2
    W.G. Guest

    Default RE: ASP vs VB code

    when using dsn with asp, you must create a system level DSN using the ODBC Datasource Administrator. Use this to tie the DSN name to your oracle drivers. Depending on the drivers you are using, this should be a straight forward selection from the drivers selection.<BR><BR>

  3. #3
    Matiur Rahman Guest

    Default RE: Yes, I used system DSN

    It works from VB, but it does not work from ASP.<BR>That I am confused about.

Posting Permissions

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