Murray Brown
asked on
VB.net Create a query inside an Access database
Hi. I am using the following VB.net code to create a view inside a SQL database.
What similar code would I use to create a query inside an Access database?
Sub Create_SQL_View(ByVal oViewName As String, ByVal oSQL As String)
Dim myConnection As SqlConnection = New SqlConnection(Globals.This AddIn.oRIG HT.lblConn ectionStri ng.Text)
Dim myCommand As SqlCommand
myConnection.Open()
Dim S As String = "CREATE VIEW " & oViewName & " AS " & " " & oSQL
myCommand = New SqlCommand(S, myConnection)
myCommand.ExecuteNonQuery( )
myConnection.Close()
End Sub
What similar code would I use to create a query inside an Access database?
Sub Create_SQL_View(ByVal oViewName As String, ByVal oSQL As String)
Dim myConnection As SqlConnection = New SqlConnection(Globals.This
Dim myCommand As SqlCommand
myConnection.Open()
Dim S As String = "CREATE VIEW " & oViewName & " AS " & " " & oSQL
myCommand = New SqlCommand(S, myConnection)
myCommand.ExecuteNonQuery(
myConnection.Close()
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER