p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Create View


Message #1 by "Kai" <csmh@g...> on Fri, 14 Sep 2001 16:31:28
Try with a connection

	set objCommand=server.createObject("ADODB.Connection")
	objCommand.open objConn
	sql = "Create View TopVerification as Select Top 1 Verification.Date,
Verification.* from Verification " & _
			"WHERE Verification.CliSSN='" & strSSN & "' ORDER BY Verification.Date
DESC"
	objCommand.execute (sql)

	set objCommand=Nothing


Steven Broos
        Project Developer
  _____

Netural Design - Web Development and Graphical Design - Antwerpse Steenweg
124, 2640 Aartselaar
netural.be <http://www.netural.be/>  - Tel.: +xx xxx xx xx xx - Fax.: +xx x
238 64 22



-----Original Message-----
From: Kai [mailto:csmh@g...]
Sent: vrijdag 14 september 2001 16:31
To: Code Clinic
Subject: [proasp_codeclinic] Create View


Hi, everyone:
  I was trying to create a view in my ASP as following:
	set objCommand=server.createObject("ADODB.Command")
	objCommand.activeConnection=objConn
	objCommand.CommandText="Create View TopVerification as Select Top
1 Verification.Date, Verification.* from Verification " & _
			"WHERE Verification.CliSSN='" & strSSN & "' ORDER
BY Verification.Date DESC"
	objCommand.CommandType=adCmdText

	set objRS=objCommand.Execute
	set objCommand=Nothing

However, the system keeps giving a error message:
Microsoft JET Database Engine (0x80004005)
Only simple SELECT queries are allowed in VIEWS.

Is anyone could help me with this problem? Thanks a lot!

Kai

  Return to Index