INSERT INTO (mode connecté)

VISTA , VB.NET , VB2005 Charleroi, Belgium
  • 8 years 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 a reply

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

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

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There's no test like production” - Anon