Community discussion forum

INSERT INTO (mode connecté)

  • 2 months ago

    Hello, I am learning VB2005 How can i insert a date (with a variable date) in an existing table (MSAccess)

    dim varDate as date dim cmd as oledbcommand cmd= new oledbcommand cmd.connection=con cmd.commandtext=" insert into MaTable (date) values (" & varDate & ")" ----> does not work !!! cmd.commandtext=" insert into MaTable (date) values ('" & varDate & "')" ----> does not work !!! cmd.commandtext=" insert into MaTable (date) values (#" & varDate & "#)" ---> does not work !!! cmd.executenonquery

    Thanks for your help .

    Post was edited on 22/09/2009 08:56:01 Report abuse

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

We'd love to hear what you think! Submit ideas or give us feedback