VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



All source should be free...Create a View and Drop a View on the fly...Couldnt find this anywhere..

by kAOs (9 Submissions)
Category: Windows System Services
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 25th March 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

All source should be free...Create a View and Drop a View on the fly...Couldnt find this anywhere...I needed it for MS Access ADP as i didn't

Rate All source should be free...Create a View and Drop a View on the fly...Couldnt find this anywhere..



'       - Command1: Creates the view
'       - Command2: Drops the view
'
' TODO: Change Connection String
'
' TODO: Change Command Text for Create View
'
' TODO: Change Command Text for Drop View
'
' TODO: Add a refernce for the ADODB library 
'

Dim xCn As New ADODB.Connection
Dim xCmd As New ADODB.Command

Private Sub Form_Load()

    xCn.ConnectionString="Provider=Provider;UID=sa;Catalog=Cat;Data Source=kAOs"
    xCn.Open
    xCmd.ActiveConnection = xCn

End Sub

Private Sub Command1_Click()
    
    xCmd.CommandText="CREATE VIEW vw_View AS SELECT * FROM tbl WHERE Fld=param"
    xCmd.Execute

End Sub

Private Sub Command2_Click()

    xCmd.CommandText = "DROP VIEW vw_View1"
    xCmd.Execute

End Sub


Download this snippet    Add to My Saved Code

All source should be free...Create a View and Drop a View on the fly...Couldnt find this anywhere.. Comments

No comments have been posted about All source should be free...Create a View and Drop a View on the fly...Couldnt find this anywhere... Why not be the first to post a comment about All source should be free...Create a View and Drop a View on the fly...Couldnt find this anywhere...

Post your comment

Subject:
Message:
0/1000 characters