Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a view in VB Code

Status
Not open for further replies.

EZEason

Programmer
Dec 11, 2000
213
US
I have a form that has about 18 text fields. What I need to know is can I write a code that will create a view in SQL 7 (MSDE) or in VB Data Enviornment that will save the values selected on the form and show the results on another form. The just is what is the code to creata a view, where is that view create(VB or SQL), and how does it save the critera value from the text fields? What doesn't kill you makes you stronger.
 
You need to make an ado connection to your sql server.

Then you need to make a recordset.

Then you could assign each textbox's value to a variable.

Then you could do a rs.excute(strSQL) with your variables in there for a SQL command.

I forget the syntax to create a view since I usually do them with the designer in SQL Server. I think its like "CREATE VIEW [Name] SELECT blank FROM blank". You'll want to check on the correct syntax for sure though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top