Question on Variables

Results 1 to 2 of 2

Thread: Question on Variables

  1. #1
    Join Date
    Dec 1969

    Default Question on Variables

    I have a few stupid basic questions:<BR><BR>When I program ASP using VBScript I notice that I don&#039t have to use DIM to make my variables work (test_var = "whatever"). Should I use DIM (Dim objConn) and why? Why do we use SET? I notice SET is used with connections strings (Set objConn = Server.CreateObject("ADODB.Connection")). What kind of variable does SET create and why use it? Which variables should we set to nothing?

  2. #2
    Ray Wadkins Guest

    Default RE: Question on Variables

    I can&#039t speak to the benefits of declaring your variables in ASP in that you can&#039t declare their type anyway so, since it&#039s not necessary, I always ask myself...why bother? Maybe somebody will tell me.<BR><BR>Set is used to set and object variable. An ADODB.Connection is an object and you set it to a variable with the SET command. using SET with other "flat" variables should give you an error

Posting Permissions

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