Cure my ASP problem!

Discussion in 'OT Technology' started by DatacomGuy, Oct 13, 2004.

  1. DatacomGuy

    DatacomGuy is moving to Canada

    Joined:
    Oct 14, 2002
    Messages:
    16,546
    Likes Received:
    0
    Location:
    Tampa, FL
    Code:
    Line 5:  Dim strSQL		  
    Line 6:  
    [color=red]Line 7:  Set adoCon = Server.CreateObject("ADODB.Connection") 
    [/color]Line 8:  
    Line 9:  adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/*********")
    Error message:

    Compiler Error Message: BC30807: 'Let' and 'Set' assignment statements are no longer supported.

    If Set is no longer supported, what's it replaced by?
     
  2. Keyzs

    Keyzs OT Supporter

    Joined:
    Nov 3, 2003
    Messages:
    814
    Likes Received:
    0
    Location:
    Charlotte, MI
    Code:
    Dim objConnection As OleDbConnection
    Dim strSQLQuery As String
    Dim objCommand As OleDbCommand
    Dim objDataReader As OleDbDataReader
    		
    objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database.mdb") & ";")
    
    strSQLQuery = "SELECT * FROM database WHERE Field = Whatever"
    
    objCommand = New OleDbCommand(strSQLQuery, objConnection)
    
    objConnection.Open()
    
    objDataReader = objCommand.ExecuteReader(CommandBehavior.CloseConnection)
    
    Got to love .NET, life just got a little harder.

    By the way what is giving you that error? Is it from IIS, if so what version? As far as I know up to IIS6.0 will still run ASP3x code...
     
  3. DatacomGuy

    DatacomGuy is moving to Canada

    Joined:
    Oct 14, 2002
    Messages:
    16,546
    Likes Received:
    0
    Location:
    Tampa, FL
    Not sure what version they are using.. it's actually a remote host.. I use Brinkster's free service.

    I will replace with the new code and give it a shot. Thanks.;)
     
  4. DatacomGuy

    DatacomGuy is moving to Canada

    Joined:
    Oct 14, 2002
    Messages:
    16,546
    Likes Received:
    0
    Location:
    Tampa, FL
    Well, that wasn't my only error.. I used the Set command all over the place..


    Code:
    (9) : error BC30800: Method arguments must be enclosed in parentheses.
    adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/rexelusa/db/orders.mdb")
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~											
    (11) : error BC30807: 'Let' and 'Set' assignment statements are no longer supported.
    Set rsAddOrder = Server.CreateObject("ADODB.Recordset")
    ~~~													
    (23) : error BC30800: Method arguments must be enclosed in parentheses.
    rsAddOrder.Open strSQL, adoCon
    				~~~~~~		
    (42) : error BC30807: 'Let' and 'Set' assignment statements are no longer supported.
    Set rsAddOrder = Nothing
    ~~~					 
    (43) : error BC30807: 'Let' and 'Set' assignment statements are no longer supported.
    Set adoCon = Nothing
    ~~~				 
    (46) : error BC30800: Method arguments must be enclosed in parentheses.
    Response.Redirect "/rexelusa/addorder.aspx"
    I attached my entire code in txt format... Feel like taking a second to help me some more?
     
  5. Keyzs

    Keyzs OT Supporter

    Joined:
    Nov 3, 2003
    Messages:
    814
    Likes Received:
    0
    Location:
    Charlotte, MI
  6. DatacomGuy

    DatacomGuy is moving to Canada

    Joined:
    Oct 14, 2002
    Messages:
    16,546
    Likes Received:
    0
    Location:
    Tampa, FL
    I will play with it tonight..

    Thanks for your help, I appreciate it. ;)
     
  7. DatacomGuy

    DatacomGuy is moving to Canada

    Joined:
    Oct 14, 2002
    Messages:
    16,546
    Likes Received:
    0
    Location:
    Tampa, FL
    OK, I loaded the page. Connects to the db without a problem.

    Here is my newest error.

    Code:
    [font=Arial] [/font]
    
    
    ADODB.Recordset[font=Times New Roman][size=3] [/size][/font][font=Arial][size=2]error '800a0cc1'[/size][/font][font=Times New Roman][size=3] [/size][/font]
    
    [font=Arial][size=2]Item cannot be found in the collection corresponding to the requested name or ordinal.[/size][/font] [font=Arial][size=2]/rexelusa/addresults.asp[/size][/font][font=Arial][size=2], line 35[/size][/font] 
    And the corresponding section of code, lines 30-45:

    Code:
    ' Create ADO recordset.
    Set rsAddOrder = Server.CreateObject("ADODB.Recordset")
     'open record set...  Rest is pretty logical...
     rsAddOrder.Open strSQL, strOrdersConnection, adOpenKeyset, adLockPessimistic, adCmdText
      rsAddOrder.AddNew
       rsAddOrder.Fields("Name") = Request.Form("cname")
       rsAddOrder.Fields("Date") = Request.Form("odate")
       rsAddOrder.Fields("CustPO") = Request.Form("custpo")
       rsAddOrder.Fields("ShipDate") = Request.Form("ordshdate")
       rsAddOrder.Fields("Method") = Request.Form("shipmethd")
       rsAddOrder.Fields("Track") = Request.Form("shiptrack")
       rsAddOrder.Fields("Ordtotal") = Request.Form("ordrtotal")
       rsAddOrder.Fields("Notes") = Request.Form("ordnotes")
      rsAddOrder.Update
     rsAddOrder.Close
    Set rsAddOrder = Nothing
    
    I'm assuming this a name labeling error of some sort?
     
  8. Keyzs

    Keyzs OT Supporter

    Joined:
    Nov 3, 2003
    Messages:
    814
    Likes Received:
    0
    Location:
    Charlotte, MI
    That means a field is not named the same or does not exist in the table tblorderentry. (or if your typing is anything like mine, spelled wrong!)

    My guess is Fields("Ordtotal") since its names differnt on the form Form("ordrtotal")
     
  9. DatacomGuy

    DatacomGuy is moving to Canada

    Joined:
    Oct 14, 2002
    Messages:
    16,546
    Likes Received:
    0
    Location:
    Tampa, FL
    Hmm.

    Damn I'm learning a lot.
     

Share This Page