object required error - any help much appreciated

  • Hi

    I have an error in my page, the error is:

    Microsoft VBScript runtime error '800a01a8'

    Object required: ''

    /admin/PageSubmissions.asp, line 102

    Line 102 is as follows:

    conn.Execute("EXEC InsertNextPage @StoryID='" & Request.Form("StoryID") & "', @SubscriberID='" & Request.Form("SubmitterID") & "', @Content='" & Cleanse(Request.Form("SubmittedPage")) & "'")

    I have been struggling with this error for a while now and cant seem to fix it...

    I tried adding the story directly into the database table (SQL Server table) but this resulted in another error Error -2147217900 - Syntax error or access violation

    If someone could possibly help me try and solve this error, it would be much appreciated!

    I can provide any further information, you might need.

    Thank you in advance

    Missa

  • Please post the declarations and instantiation of the conn object.


  • hi

    Is this the part you need? (The last paragraph of the code being line 102)

    Thanks for your help.

    Dim submission

     Set submission = Server.CreateObject("ADODB.Recordset")

     submission.Open "SELECT * FROM FamousFacesSubmissions WHERE SubmissionID='" & Request.Form("SubmissionCB") & "'", conn

     conn.Execute("EXEC InsertNextPage @StoryID='" & submission.Fields("StoryID") & "', @SubscriberID='" & submission.Fields("SubscriberID") & "', @Content='" & Cleanse(submission.Fields("Content")) & "'")

     Dim FailedRequests

     Set FailedRequests = Server.CreateObject("ADODB.Recordset")

     FailedRequests.Open "SELECT * FROM FamousFacesSubmissions WHERE StoryID='" & submission.Fields("StoryID") & "' AND NOT SubmissionID='" & Request.Form("SubmissionCB") & "'", conn

     conn.Execute("DELETE FROM FamousFacesRequests WHERE StoryID='" & submission.Fields("StoryID") & "'")

     conn.Execute("DELETE FROM FamousFacesSubmissions WHERE StoryID='" & submission.Fields("StoryID") & "'")

     submission.Close

     conn.Close

     Response.Redirect("Stories.asp")

    ElseIf Not (Request.Form("SubmitAdminPage") Is Nothing) AND Request.Form("SubmitAdminPage") <> "" Then

     conn.Execute("EXEC InsertNextPage @StoryID='" & Request.Form("StoryID") & "', @SubscriberID='" & Request.Form("SubmitterID") & "', @Content='" & Cleanse(Request.Form("SubmittedPage")) & "'")

     

     

  • Try commenting out line 102 and replace it with

    response.write("EXEC InsertNextPage @StoryID='" & submission.Fields("StoryID") & "', @SubscriberID='" & submission.Fields("SubscriberID") & "', @Content='" & Cleanse(submission.Fields("Content")) & "'")

    This should write a T-SQL command string to your PC as you execute it. If you still get the error, try using response.write on the individual components that make up the command string to narrow down where the error is occurring.


  • hi

    sorry for the probably dumb question, but will that just display test messages on the page with the results of trying that query to then try and find the problem and fix it?

    Or do you think doing that will fix the problem?

    Reason I ask is this is a live site that has just launched, and im trying to help some friends who have been let down by the people who built the site, but people are visiting and I dont want to muck things up and have test messages displaying.

    As you can possibly tell from my questions im not really 'up' on SQL databases etc, im more of a designer personally.

    Thanks for your assistance

    Missa

  • OK - don't do it, you are right!! It will not fix anything, I was merely trying to help you troubleshoot exactly where the error was being generated. But that's not something you want the public to see

    Maybe someone here more familiar with ASP will be able to spot the error straightaway, but I cannot.

    I would recommend anyway that you or your friends build a dev / testing environment for the app where you can perform such troubleshooting and also test out any new features and functions before they go live. Best of luck.

     


  • hi

    thanks for confirming my thoughts regarding that.

    I appreciate all your help and hopefully someone might be able to help spot the error.

    I think a testing environment would be a good idea to test things on and then upload, I do know though that some fuctionality relies on a scheduled task which with the hosting they use they are charged for and would have to pay double for it to be setup in testing environment.

    Do you know at all what the error was when I tried to add the story page directly into the DB table? I.e. the syntax / access violation one?

    Thank you again

    Missa

     

  • No problem. Regarding the syntax / access violation problem, can you post the SQL command that you issued?


  • Hi

    I didnt do it like that, their hosting company has a web based enterprise manager and when viewing the relevant table there was the option to insert a new row, which I selected and just tried to paste the info into the relevant fields (kind of like what you would do for microsoft access)

    Was this wrong?

    I can give you details of the table, table rows and the info I would like to insert into each if I need a sql statement and you would be able to assist in constructing one?

     

  • The very existence of an 'insert row' option makes it difficult to suggest that this is 'wrong'

    You are using tools that I have not used - makes this more interesting, I guess - but can you try doing the insert again. Be particularly careful that you:

    • Do not enter character data in numeric fields (eg O instead of 0)
    • Do not exceed field widths
    • Watch primary key constraints. If the primary key is an IDENTITY field, you should let the system generate it for you.

    A good test is to try inserting a row that contains exactly the same sort of data as one of the existing rows - that way, you should eliminate any possible data issues.

    Failing all of this, we can try a SQL INSERT INTO statement. Do you have an environment where you can run such commands?

    Phil


  • Hi

    the table fields are as follows:

    SubmissionID - PK - 16

    StoryID - FK - 16

    SubscriberID - FK - 16

    DateSubmitted - datetime - 8

    Content - varchar - 5000

    Selected (checkbox)

     

    Will be difficult to do SQL statement with a long description (content) wont it?

     

    Still getting the error...

     

     

     

  • Try inserting the row without the CONTENT and SELECTED fields first. If it works, we'll move on to CONTENT.

    INSERT INTO mytable (SubmissionID, StoryID, SubscriberID, DateSubmitted)
    VALUES (p1, p2 ,p3 ,GetDate())

    and see what happens.

    Obviously, you'll have to replace p1, p2, p3 etc with actual values. Literal text should be surrounded by single quotes - eg 'phil'. As StoryID and SubscriberID are FKs, they must already exist in their PK tables (sorry if that's obvious).


  • hi

    sorry for the delay in getting back to you.

    I have been having problems with submissionID field

    I dont have any examples of how this should look / be constructed etc, all I know is that the field format setup is the same as the requestID in requests table.

    They seem to be random activation code sequences that are generated by the system...

    I tried using a requestID example one in the submissionID field but im still getting the same error...

    Any thoughts?

     

     

  • So the question is: "What generates the SubmissionID code?"

    If it's a SQL Server IDENTITY field, you can try the INSERT statement I gave you, but without the SubmissionID, ie

    INSERT INTO mytable (StoryID, SubscriberID, DateSubmitted)
    VALUES (p2 ,p3 ,GetDate())

    and let SQL Server generate the PK for you. Otherwise, I guess you're going to have to track down the keygen code in the system. It's Friday: hope these friends are buying you lots of beer to compensate


  • Hi

    this is the example requestID one I previously tried to use in the SubscriberID field.

    {3361F5F7-E284-4CF1-8451-8A39CB381806}

    These types of codes seem to be used in storyID, subscriberID etc type fields

    Any idea on what this is / where it might be getting generated?

    I dont think its a keygen exactly but some type of random generated number

    I will try out that SQL statement without the submissionID field in and fingers crossed that will work and then its just updating it to include the long content somehow.. (is a story page)

     

     

Viewing 15 posts - 1 through 15 (of 25 total)

You must be logged in to reply to this topic. Login to reply