www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Dynamic view within ASP Page

  1. #1
    Join Date
    Oct 2006
    Posts
    93

    resolved [RESOLVED] Dynamic view within ASP Page

    Hi,
    I am trying to merge data from 2 different tables without actually having to create a view in the database, then display it on the screen.

    What I did was first actually create the view, then try to use the SQL code it generated in my ASP page.
    ie
    Code:
    SELECT dbo.Table1.*, dbo.Table2.zProjectID FROM dbo.Table1 INNER JOIN dbo.Table2 ON dbo.Table1.zCRFID = dbo.Table2.ID
    This works fine within the database, but when I try and use this to get a record set it gives me the error [ ADODB.Recordset error '800a0bb9' Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. ]

    This is what I want to do....

    Code:
    myStr="SELECT dbo.Table1.*, dbo.Table2.zProjectID AS Expr1 FROM dbo.Table1 INNER JOIN dbo.Table2 ON dbo.Table1.zCRFID = dbo.Table2.ID"
    		
    set myRecord=server.CreateObject ("ADODB.Recordset")
    myRecord.Open myStr,myDB,1,1
    So my question is this even possible and if so what am I doing wrong?
    Thnx!

  2. #2
    Join Date
    Oct 2006
    Posts
    93
    Figured it out. Overlooked instantiating the [myDB] connection. Duh!

    So the answer is, of course you can do it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles