S
Swifty_SySoP
Hello everyone,
I have a question about SQL connection strings. I have a VB.NET
application where the user enters in a name and password into 2 text
boxes: txtName and txtPass, respectively. I have 2 variables that
takes any input from txtName and txtPass and puts them into two
variables: strUser and strPass, respectively.
I would like to use variables because not only is strUser used in
the ID, it is also the name of the database that the user connects to.
Here's what I have so far:
Imports System.Data.SqlClient
....
Dim oSQLConn As String
oSQLConn.ConnectionString = "Data Source=Bluffton_4" & _
"Initial Catalog=strUser;" & _
"User ID=strUser;" & _
"Password=strPass" & _
"Encrypt=yes"
oSQLConn.open()
I have noticed with the strUser and strPass it does act like a
variable: it only acts like text which really will not work well with
me. Is there some way to make the program recognize a variable for
the SQL Connection? Or some other idea that would be better? If
anyone could help me, this would be greatly appreciated. Thank you
for your time.
BTW - This program would only be used in our intranet and we do not
run Active Directory so I cannot use SSPI. Thanks again!
James Haynes
I have a question about SQL connection strings. I have a VB.NET
application where the user enters in a name and password into 2 text
boxes: txtName and txtPass, respectively. I have 2 variables that
takes any input from txtName and txtPass and puts them into two
variables: strUser and strPass, respectively.
I would like to use variables because not only is strUser used in
the ID, it is also the name of the database that the user connects to.
Here's what I have so far:
Imports System.Data.SqlClient
....
Dim oSQLConn As String
oSQLConn.ConnectionString = "Data Source=Bluffton_4" & _
"Initial Catalog=strUser;" & _
"User ID=strUser;" & _
"Password=strPass" & _
"Encrypt=yes"
oSQLConn.open()
I have noticed with the strUser and strPass it does act like a
variable: it only acts like text which really will not work well with
me. Is there some way to make the program recognize a variable for
the SQL Connection? Or some other idea that would be better? If
anyone could help me, this would be greatly appreciated. Thank you
for your time.
BTW - This program would only be used in our intranet and we do not
run Active Directory so I cannot use SSPI. Thanks again!
James Haynes