Hey Bill! it's there Now!

Results 1 to 2 of 2

Thread: Hey Bill! it's there Now!

  1. #1
    rwashington Guest

    Default Hey Bill! it's there Now!

    I added "adovbs.inc" to my root of my web app, and inserted this at the top of the AddtoCart.asp page. <BR><BR> &#060;!-- #include file="adovbs.inc" --&#062; <BR><BR>Even though I use: &#060;!-- METADATA TYPE="typelib" FILE="C:Program FilesCommon FilesSystemadomsado15.dll" --&#062; in my connection page (dataConnect.asp). <BR><BR>So my code now looks like: <BR><BR>&#060;!-- #include file="adovbs.inc" --&#062; <BR>&#060;!-- #include file="dataConnect.asp" --&#062; <BR>&#060;% <BR>Dim rsItem <BR>Set rsItem = Server.CreateObject("ADODB.Recordset") <BR><BR>rsItem.Open "KritikalCart", objConn, 0, 3, &H0002 <BR><BR><BR>If Request.Form("appleBox") = "A00" Then &#039;the checkbox <BR>rsItem.AddNew <BR><BR>rsItem("UserName") = Session("UserName") <BR>rsItem("ProductID") = Request.Form("appleBox") <BR>rsItem("ProductName") = "applePkg" <BR>rsItem("Quantity") = CInt(Request.Form("appleQuantity")) <BR><BR>rsItem.Update <BR>End If <BR><BR>rsItem.Close <BR>Set rsItem = Nothing <BR>Response.Redirect "kritikalCart.asp" <BR>%&#062; <BR><BR>Now my error is: <BR><BR>Microsoft VBScript runtime error &#039;800a0411&#039; <BR><BR>Name redefined: &#039;adOpenForwardOnly&#039; <BR><BR>/clients_assignments/ect410/finalProject/adovbs.inc, line 14 <BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Overkill now...

    If you were using the METADATA before, then I dunno why you were getting the error! Perhaps one of the adXXX values is missing from the type library???<BR><BR>Anyway, the error makes sense: You&#039;ve got that stuff defined in your metadata, so now you can&#039;t include adovbs.inc.<BR><BR>But what do you care? You changed to <BR>rsItem.Open "KritikalCart", objConn, 0, 3, &H0002 <BR>so you aren&#039;t using the variables any more, anyway. A hack, but it works. <BR><BR>Only thing I can think of is maybe you misspelled one of the constants before. <BR><BR>You know, *all* this stuff can be avoided by using &#060;%OPTION EXPLICIT%&#062; so that VBS won&#039;t even *let* you use names that aren&#039;t defined...and will thus tell you if something is (for example) spelled wrong.<BR><BR><BR><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