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

    Sorry to post it again. I have not got this answered...<BR><BR>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") <BR> <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
    Steve Cimino Guest

    Default RE: ASP vs VB code

    You need to enclose all asp code between &#060;%%&#062; tags.<BR><BR>&#060;%Private Sub<BR>...<BR><BR>End Sub%&#062;

  3. #3
    Matiur Rahman Guest

    Default RE: Syntax is not the problem

    Thanks for your reply. I know what you are saying.<BR><BR>But the problem is why ASP code can&#039t connect the Database while VB client application can make the connection. I use Identcal codes and the same connection string.<BR><BR>I don understand why???<BR>

Posting Permissions

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