If I am understanding you correctly I put the code like this
<script runat="server">
Dim dbconn1 As SqlConnection = New SqlConnection("server=AM1ST_FS1;database=HRINFO;uid=sa;"

Dim selectCMD5 As SqlCommand = New SqlCommand()
selectCMD5.CommandText = "Select * from employeeinfo where userID = '" & request.servervariables("AUTH_USER"

& "'"
selectCMD5.Connection = dbconn1
dbconn1.open
if selectCMD1.ExecuteNonQuery() = 0 then
selectCMD5.CommandText = "Select * from employeeinfo where userID = 'AM1ST_DOMAIN\" & request.servervariables("AUTH_USER"

& "'"
end if
dbconn1.close
selectCMD5.CommandTimeout = 30
Dim empDA As SqlDataAdapter = New SqlDataAdapter
empDA.SelectCommand = selectCMD5
dbconn1.Open()
Dim empDS As DataSet = New DataSet
empDA.Fill(empDS, "employeeinfo"

dbconn1.Close()
Public Sub Page_Load(Source as Object, E As EventArgs)
'code here
End Sub
This produces the following error though, Why? this code works when enclosed in a sub?
Compiler Error Message: BC30188: Declaration expected.
Source Error:
Line 10: Dim selectCMD5 As SqlCommand = New SqlCommand()
Line 11:
Line 12: selectCMD5.CommandText = "Select * from employeeinfo where userID = '" & request.servervariables("AUTH_USER"

& "'"
Line 13: selectCMD5.Connection = dbconn1
Line 14: dbconn1.open
Source File: E:\Intranet\Mystuff\Mystuff\personal.aspx Line: 12