borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Screen Resolution (Changing))Next Topic (File Existance Checking) New Topic New Poll Post Reply
AndreaVB Forum : Frequently Asked Questions : Create A Database
Poster Message
vbgen
Level: Moderator

Registered: 10-10-2002
Posts: 876

icon Create A Database

'Create an MS-ACCESS Database with VB
'Include the Below References from Project Menu
'Microsoft ActiveX Data Objects 2.1 Library
'Microsoft ActiveX Data Objects RecordSet 2.1 Library
'Declare these Variables
Dim Com as New ADODB.Command
Dim Con as New ADODB.Connection

Private Sub CreateNewDatabase()
  'Specify the Connection as below
  Con.Provider="Microsoft.Jet.OLEDB.3.51"
  'specify the Database here
  Con.Open "c:windowsdesktopCreatedDB.mdb"
  Com.ActiveConnection=Con
  'Code
  Com.Commandtext="Create table CreatedTable(TableNo number(4));"
  Com.Execute
End Sub


Also hoping for feedback on this if there are any problems...

thanks.  

____________________________
Been busy trying to take a second degree <--it's not working out...

01-04-2003 at 01:09 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Frequently Asked Questions : Create A Database
Previous Topic (Screen Resolution (Changing))Next Topic (File Existance Checking) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder