Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: DSN too long


Message #1 by Kevin D Riggs <kevin.riggs@p...> on Wed, 03 May 2000 15:01:24 -0400
I've written many database access pages using only ASP scripting but I

want to move to COM components.





To this end, I have created an ActiveX DLL app that does not require any

arguments and returns a type of String.



After registering this dll, I have tried to access it using the ASP

script at the bottom of this e-mail and I always get errors.  The one I

continue to get right now is "DNS too long."





thanks for any help,





KD









>>>>>>>>>>>>>>>>>>Component

Code<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<





Public Function businessCount() As String





    On Error GoTo errCount





    Dim conn As ADODB.Connection



    Dim rs As ADODB.Recordset



    Dim strSQL As String



    Dim strHTML As String



    Dim intQty As Integer



    



    strSQL = "SELECT * FROM business ORDER BY name"



    intQty = 1



    vntError = ""



    



    Set conn = CreateObject("ADODB.Connection")



    Set rs = CreateObject("ADODB.RecordSet")



    



    conn.Open strConnect



    rs.Open strSQL, conn, 3, 3



    



    While Not rs.EOF



        strHTML = strHTML & intQty & ". " & rs("name") & "<<br>" &

vbCrLf



        intQty = intQty + 1



        rs.MoveNext



    Wend



    



    rs.Close



    conn.Close



    



    businessCount = strHTML



    



    Set rs = Nothing



    



    Exit Function



    



errCount:



	 strHTML = "There was an error accessing the database on the server." &

vbCrLf



        businessCount = strHTML



    



End Function







>>>>>>>>>>>>>>>>>>>End

Code<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<<<<<<<<<<<<<<<<<<<<









>>>>>>>>>>>>>>>>Beginning ASP

Script<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<&l
t;<<<<<<





<excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt&
gt;<excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excer
pt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><excerpt><ex
cerpt><excerpt><excerpt><excerpt><excerpt><<<color><param>8080,0000,8080</param>b
ody</color>>



<<<color><param>ffff,0000,ffff</param>%



</color>



Dim count





Set count = Server.CreateObject("g.Reports")





Response.write "<<u>Business Count<</u><<br><<br>" & vbCrLf



Response.Write count.businessCount



<color><param>ffff,0000,ffff</param>%</color>>



<<<color><param>8080,0000,8080</param>/body</color>>



</excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt><
/excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></exc
erpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt
></excerpt></excerpt></excerpt></excerpt></excerpt></excerpt>>>>>>>>>
>>>>>>>>>>>>>>End

Script<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<&l
t;<<<<<<<<<<<<















Kevin D Riggs





kevin.riggs@p...





Senior Network Administrator & Webmaster



Rhea County



Board of Education





http://www.rhea.k12.tn.us/



http://www.rheacounty.org/

Message #2 by "Subbu .." <subramaniam_s_iyer@m...> on Thu, 04 May 2000 22:13:29 +0530
Hi there Kevin,

Let me ask you one thing..



Is this an ASP error or an http error.. It's got to do with the Domain(The 

URL Basically) That's why the Domain Naming Service Error(DNS)



What I mean is, When the error is generated, does it gives the file name

(.asp file name) and the line number of the error... ??



I hope I am making some sense.

Do get back Kevin.



Bye

Subbu...



--



On Wed, 03 May 2000 15:01:24   Kevin D Riggs wrote:

Message #3 by Kevin D Riggs <kevin.riggs@p...> on Thu, 04 May 2000 14:32:11 -0400
The error is a DSN (Data Source Name) not a DNS (Domain Name Service) error.



The asp page is generated and returned to the client but with a server

component error.  I tried to raise the error and return it by setting the

component function name equal to the error using (function_name 

Err.Number & " - " & Err.Description) but even when I began the whole

component with "On Error GoTo error_handler, I still get a DSN error.





Thanks,



KD





Kevin D Riggs



kevin.riggs@p...



Senior Network Administrator & Webmaster

Rhea County

Board of Education



http://www.rhea.k12.tn.us/

http://www.rheacounty.org/


  Return to Index