index | search | no replies | posting guidelines | help login | register
Index » Products » ASP Report Wizard v2
search this forum:
:: Product on XP Pro ::    show all messagesPost a New Message | Post a Reply
Mar 25 2004, 11:28 AM
 Re: Product on XP ProPost a Reply
 whichman

View this author's profile Send this author a private message Visit author's homepage

from: Laurel, MD

Do the following:

1. Make sure you can view all your file extensions
2. Make sure your file extension is ASP e.g. default.asp and NOT default.asp.txt
3. Copy the code below into your default.asp file, run this file and tell me what you see:

<%
  
  On  Error  Resume  Next  
  
  Const MDB_PATH = "C:\Test.mdb"
  
CheckFile  
ListTables  
TestReportWiz  
  
  If Err.Number <> 0  Then  
     PrintError("")  
  End  If  
  
  Sub TestReportWiz()  
  
     Dim objWiz  
     Set objWiz = Server.CreateObject("AspWebSolution.ReportWizard2")  
      
    'Make sure you initialize before adding any HTML text  
     objWiz.Init "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE= "(& MDB_PATH)  
          
    'put this where you want your reports  
     objWiz.DisplayReports  
      
     Set objWiz =  Nothing  
  
  End  Sub  
  
  Sub PrintError(s)  
     If s= "" Then s= "Error #: "& Err.Number & "<br>"& Err.Description & "<br>Source: "& Err.Source  
     Response.Write "<font color=red>"& s & "</font>"
  End  Sub  
  
  Sub CheckFile  
     Dim FSO  
     Set FSO = Server.CreateObject("Scripting.FileSystemObject")  
     If Not FSO.FileExists(MDB_PATH)  Then  
         PrintError("Your database file <b>"& MDB_PATH & "</b> does not exist.")  
     End  If  
  End  Sub  
  
  Sub ListTables()  
   Dim Conn  
   Set Conn = Server.CreateObject("ADODB.Connection")  
   Conn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE= "& MDB_PATH ";"&
    
'Create catalog object  
   Dim Catalog  
   Set Catalog = Server.CreateObject("ADOX.Catalog")  
   Set Catalog.ActiveConnection = Conn  
    
'List tables And columns  
   Dim Table, added  
   For Each Table In Catalog.Tables  
     If Table.Type = "TABLE" Then  
       Response.Write Table.Name & "<br>"
       added=True  
     End  If  
   Next  
    
   If Not Added  Then  
     PrintError("You do not have any tables in your database")  
   End  If  
  End  Sub  
  
%>



-------------------------
Master of the Game
Pages: (1)   [1]

search this forum: