Archive
Calender
<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011
Blogroll
    Recent comments

    None

    The problem I had was creating a table in MS Access 2007 with constraints via vb.Net without the OleDb crying out foul. Also setting defaults in the SQL was a big headache…

    Primary key: [Primay_Key] autoincrement not null
    boolean, YesNo: [Field_Name] yesno not null
    Date: [Field_Name] datetime not null default Now()
    Text: [Field_Name] text(25) not null default “”
    Image [Field_Name] oleobject
    Integer [Field_Name] int not null default 0
    Assign Primary Key : primary Key (Field_Name)
    assign foreign key : Foreign Key (Field_Name) references [Field_Table](Field_Name)

    Primary key: [Primay_Key] autoincrement not null
    boolean, YesNo: [Field_Name] yesno not null
    Date: [Field_Name] datetime not null default Now()
    Text: [Field_Name] text(25) not null default “”
    Image [Field_Name] oleobject
    Integer [Field_Name] int not null default 0
    Assign Primary Key : primary Key (Field_Name)
    Assign foreign key : Foreign Key (Field_Name) references [Field_Table](Field_Name)

    When you assign foreign keys and you open the access database relationships, you wont see the relationships until you right click and select show all…

     

    If you are trying to insert date and time into MS Access with DbFactory, you will need to change the parameter type to single and convert the DateTime you are entering to YourDateTime.ToOADate()

    select cityId , (code + ” + name) as generaldesc from tblCity where (deleted=false);