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 View from MS Access 2000

Status
Not open for further replies.

ideafixer

Programmer
Nov 21, 2002
70
US
Does anyone know how to create a new view using Access code (possibly ADO)?
 
ADOX is the way to go, and you just create a new ADOX::View object, set its Name and Command, and append it to the list of stored procedures. The code I have for it is C++:

ViewsPtr viewsAvailable = m_pCatalog->GetViews();
ViewPtr thisView = NULL;

hr = thisView.CreateInstance(__uuidof(ADODB::View));
thisView->PutName( "myName" );
thisView->PutCommandText( "SELECT * FROM foo" );
viewsAvailable->Append( "myName", _variant_t((IDispatch *)thisView));

Not to up to date on VB, but know there is an analog there ...

Jack De Winter
Software Developer
MedTel Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top