View Full Version : See a View


mikejwalsh
09-20-2001, 06:14 AM
Hi, I've been playing with some test code to create a view in an access database programatically. The code appears to work and if I run the code a second time it fails saying the view already exists which looks good. But... when I then open the database in Access I would have expected to see the view (as a query) in the object inspector. Am I making a bad assumption here that views are really queries and should be visible or are views hidden in some way. Here is the code I'm using :-

cat.ActiveConnection = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & dbpath
' Create the command representing the view.
cmd.CommandText = "Select * From table1"

' Create the new View
cat.Views.Append "query1", cmd


Thanks in advance,
Mike