Subs help with creating objects?

Results 1 to 2 of 2

Thread: Subs help with creating objects?

  1. #1
    Join Date
    Dec 1969

    Default Subs help with creating objects?

    Ok this is related to a question that I asked yesterday but not really the same. I have a include page that has all the subroutines that I would like to use. The top of it is my connection information to the DB (Connection Object). I open up the connection there in hopes to use it in all the subs. I go to run the first subroutine that I made to see how it is going to work, it didn&#039;t.<BR><BR>When I run this code I find the errors that I talked about before (Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another). So I tried a few thing that where suggested as in setting the recordset in the connection code, this did not work. So I move all the connection code down into the sub itself, this worked.<BR><BR>Any idea why I have to put the connection information into the subroutine? I would hate to have to do this for each sub on the page. Any help would be great, thanks for you time in this for me.<BR><BR>Stephen <BR>

  2. #2
    Join Date
    Dec 1969

    Default strange

    That error, to me, tells me that the data you are submitting to the database isn&#039;t the same type as the field it&#039;s trying to submit to. This tells me that the connection object is already initialized. It&#039;s funny it works when place inside the sub. Is the connection object set inside another sub, above the one you are trying to perform database operations? If not, this is quite odd. Please post connection logic, as well as the sub that calls it. I might be able to see what&#039;s wrong.<BR>~~Chaotix

Posting Permissions

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