M
momo
Hello to all,
I need some help. I am looking for a database connection function that I can
use in my ASP.NET site. This would be in VB.NET. What I want to be able to
do is call the function and it creates the connection and I can use it in my
site. I want to pass the function some values and it uses it. Please take a
look at what I have started with and help me how to get it right.
Function OpenMsAccessOledbConn(ByVal dbPath As String, ByVal dbID As String,
ByVal dbPassword As String)
Dim dbConn As OleDbConnection
Dim dbConnStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Path & ";" & _
"User ID=" & dbID & ";" & _
"Password=" & dbPassword
dbConn = New OleDb.OleDbConnection(dbConnStr)
dbConn.Open()
End Function
When I call the function this is what I will use:
call OpenMsAccessOledbConn("db1.mdb", "admin", "admin")
Tell me also if there is a better way for doing this.
Thanks in advance.
I need some help. I am looking for a database connection function that I can
use in my ASP.NET site. This would be in VB.NET. What I want to be able to
do is call the function and it creates the connection and I can use it in my
site. I want to pass the function some values and it uses it. Please take a
look at what I have started with and help me how to get it right.
Function OpenMsAccessOledbConn(ByVal dbPath As String, ByVal dbID As String,
ByVal dbPassword As String)
Dim dbConn As OleDbConnection
Dim dbConnStr As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Path & ";" & _
"User ID=" & dbID & ";" & _
"Password=" & dbPassword
dbConn = New OleDb.OleDbConnection(dbConnStr)
dbConn.Open()
End Function
When I call the function this is what I will use:
call OpenMsAccessOledbConn("db1.mdb", "admin", "admin")
Tell me also if there is a better way for doing this.
Thanks in advance.