Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
View in access
Message
 
To
27/09/2002 23:22:39
General information
Forum:
Visual Basic
Category:
Other
Title:
Miscellaneous
Thread ID:
00705519
Message ID:
00705551
Views:
16
>hello everybody
>How Can i create a view in ms access datatables through visual basic


You can use this :
Public Sub CreateQuery()
  Dim cat As New ADOX.Catalog
  Dim cmd As New ADODB.Command
  Dim strSQL As String
  
  ' Open the catalog
  cat.ActiveConnection = _
    "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=C:\Northwind.mdb;"

  ' Create the SQL string
  strSQL = "SELECT * FROM Categories"
  
  ' Create the query by creating a new Command object.
  cmd.CommandText = strSQL
    
  ' Add the new query
  cat.Views.Append "AllCategories", cmd

  ' Close the catalog object.
  Set cat = Nothing

End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Reply
Map
View

Click here to load this message in the networking platform