Visual Studio....MS Access database modifying.
Visual Studio....MS Access database modifying.
To modify a MS Access database in Visual Studio 2005:
Visual Studio -> View -> Server Explorer. Under Data Connections, right-click MS Access database and select Modify Connection to enter username and password. Or instead of selecting "Modify Connection", select "Refresh" to connect to db.
////////////////////////////////////////////////////
Create table with no fields:
///////////////////////////////////////////////////
///////////////////////////////////////////////////
Create table with with fields:
///////////////////////////////////////////////////
///////////////////////////////////////////////////
Delete an entire table:
///////////////////////////////////////////////////
///////////////////////////////////////////////////
Insert row into a table:
///////////////////////////////////////////////////
///////////////////////////////////////////////////
Alter table - column type:
///////////////////////////////////////////////////
////////////////////////////////////////////////////
Alter table - add column
///////////////////////////////////////////////////
///////////////////////////////////////////////////
Alter Table - delete a column
///////////////////////////////////////////////////
///////////////////////////////////////////////////
Rename table
///////////////////////////////////////////////////
To modify a MS Access database in Visual Studio 2005:
Visual Studio -> View -> Server Explorer. Under Data Connections, right-click MS Access database and select Modify Connection to enter username and password. Or instead of selecting "Modify Connection", select "Refresh" to connect to db.
////////////////////////////////////////////////////
Create table with no fields:
///////////////////////////////////////////////////
CREATE TABLE tblStores///////////////////////////////////////////////////
Create table with with fields:
///////////////////////////////////////////////////
CREATE TABLE tblPersons(P_Id AUTOINCREMENT PRIMARY KEY ) CREATE TABLE tblStores (Store_ID INT NOT NULL, Store_Name CHAR, Store_Address CHAR, Store_City CHAR, Store_State CHAR, Store_Zip CHAR)CREATE TABLE tblTwitter( Twitter_Int_ID INT PRIMARY KEY NOT NULL, Twitter_Ext_ID CHAR, Twitter_UserName CHAR, Twitter_Auth_Key1 CHAR, Twitter_Auth_Key2 CHAR )CREATE TABLE tblTwitterx( Twitter_Int_ID COUNTER NOT NULL, Twitter_Ext_ID CHAR, Twitter_UserName CHAR, Twitter_Auth_Key1 CHAR, Twitter_Auth_Key2 CHAR )///////////////////////////////////////////////////
Delete an entire table:
///////////////////////////////////////////////////
DROP TABLE tblStores///////////////////////////////////////////////////
Insert row into a table:
///////////////////////////////////////////////////
INSERT INTO Persons (P_Name)
VALUES ('TestName')///////////////////////////////////////////////////
Alter table - column type:
///////////////////////////////////////////////////
ALTER TABLE tblStoresALTER COLUMN Store_ID AUTOINCREMENT PRIMARY KEY////////////////////////////////////////////////////
Alter table - add column
///////////////////////////////////////////////////
ALTER TABLE PersonsADD DateOfBirth date///////////////////////////////////////////////////
Alter Table - delete a column
///////////////////////////////////////////////////
ALTER TABLE PersonsDROP COLUMN DateOfBirth///////////////////////////////////////////////////
Rename table
///////////////////////////////////////////////////
SELECT * INTO tblStoresCorp FROM tblStoresDROP TABLE tblStores

Comments