VB Query...Help!

Results 1 to 2 of 2

Thread: VB Query...Help!

  1. #1
    Join Date
    Dec 1969

    Default VB Query...Help!

    Hi,<BR><BR>I know I am posting a few questions here. I hope this doesn&#039;t bother anyone. Any hoot, I have a query about a VB component. Now after compiling I call for it within ASP. Works great. <BR><BR>The problem:<BR><BR>1) The code has to copied across several pages.<BR><BR>e.g Code within ASP<BR><BR>Option Explicit<BR>Dim CompoVb<BR>Set CompoVb = Server.Createobject("CompoVbtest.Test")<BR><BR>Com poVb.TableN = "TestVb"<BR>blah blah<BR><BR>My question is that is it possible to have this code within VB and then just write one line of code across all pages. If so how can I do this and call for the component.<BR><BR>The second question I have is that is in regards to a previous query (yesterday&#039;s actually) which was not answered.<BR><BR>I have compiled an Upload Component as a Class module with the rest of the code. The problem occurs is that when I type in Enctype within the form tag, the form refuses to work or process the query. Why is this. I am calling 2 classes form one component<BR><BR>e.g.<BR><BR>Server.Createobject = ("Test1.DbSQL)<BR>Server.CreateObject = ("Test1.Upload")<BR><BR>The reason is because the first class enters all collected data from the form and enters that into a database. The second class is simply to upload the file to the appopriate folder. The path is to be stored by the first class.<BR><BR>What could be wrong. The classes work fine when I add Encytpe for the Upload (2nd Class) and remove it for the first class. Is there a way to get around this.<BR><BR>thanks

  2. #2
    Join Date
    Dec 1969

    Default Answer to part 1

    The easy way would be to put that code in a include file which is called by all pages that need it.<BR><BR>&#060;!--#include File="MyInclude.Asp"--&#062;<BR><BR>MyInclude.Asp would then contain:<BR>&#060;%<BR>Option Explicit<BR>Dim CompoVb<BR>Set CompoVb = Server.Createobject("CompoVbtest.Test")<BR>CompoVb .TableN = "TestVb"<BR>%&#062;<BR><BR>Sorry, I&#039;m not qualified to answer part 2.

Posting Permissions

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