Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLEDB Create View ?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00662501
Message ID:
00662544
Views:
16
Bad news. This looks like it should work. Comments included.
Set oCacheConn = CreateObject("ADODB.Connection")
cConnString = "Provider=VFPOLEDB.1;Data Source=v:\db\alldbc1.dbc"
With oCacheConn
	.CursorLocation = 2		' adUseServer
	.ConnectionString = cConnString
	.Open
End With

cExec = "Create View zview04 as Select * from aiacode2 Where cClaimType = ?cClaimTypeWanted"

'This gives an error about not enough parameters
'However making the view not parameterized works,
'But I need a parameterized view
'	Set oCMD = CreateObject("ADODB.Command")
'	oCMD.ActiveConnection = oCacheConn
'	oCMD.CommandText = cExec
'	oCMD.Execute

'This gives no error, but cannot re-run script because "DBID already exists"
'But the view does not show in the VFP7 IDE either
	Set oCMD = CreateObject("ADODB.Command")
	Set oCatalog = CreateObject("ADOX.Catalog")
	oCatalog.ActiveConnection = oCacheConn
	oCMD.CommandText = cExec
	oCatalog.Views.Append "zview04" , oCMD
What about using a stored procedure in the DBC, and through my ASP page accessing the SP and getting back an array or recordset? Have you ever done that?

Thanks.
Previous
Reply
Map
View

Click here to load this message in the networking platform