Home > Back-end >  How to in c builder access to insert a date with basic information
How to in c builder access to insert a date with basic information

Time:09-27

SQL=insert JQB. * the value (' "+ Edit1 - & lt; The Text + "', '" + Edit2 - & lt; The Text + "', '" + datetime - & gt; The value + "')
'" + datatime - & gt; The value + "', is always an error, please help me

CodePudding user response:

1, you on the error information
2, the output of your SQL, make sure no mistakes in grammar

CodePudding user response:

The ACCESS before and after the date of the add pound sign (#)

CodePudding user response:

Add the pound sign (#)

CodePudding user response:

SQL="insert into JQB values (' + Edit1 - & gt;" The Text + "', '" + ComboBox1 - & gt; The Text + "', '" + ComboBox2 - & gt; The Text + "', '+ DataTimePicker1 - & gt; The value + ', '" + Edit2 - & gt; The Text + "', '+ DataTimePicker2 - & gt; The value + ', '" + Memo1 - & gt; The Text + "')";
ADOQuery1 - & gt; Close ();
ADOQuery1 - & gt; SQL - & gt; The Clear ();
ADOQuery1 - & gt; SQL - & gt; Add (SQL);
ADOQuery1 - & gt; The Open ();
If the '+ DataTimePicker1 - & gt; The value + 'into' # DataTimePicker1 - & gt; Value# '

CodePudding user response:

The
reference 4 floor gaoyu1414 reply:
SQL="insert into JQB values (' + Edit1 - & gt;" " The Text + "', '" + ComboBox1 - & gt; The Text + "', '" + ComboBox2 - & gt; The Text + "', '+ DataTimePicker1 - & gt; The value + ', '" + Edit2 - & gt; The Text + "', '+ DataTimePicker2 - & gt; The value + ', '" + Memo1 - & gt; The Text + "')";
ADOQuery1 - & gt; Close ();
ADOQuery1 - & gt; SQL - & gt; The Clear ();
ADOQuery1 - & gt; SQL - & gt; Add (SQL);
ADOQuery1 - & gt; The Open ();
If the '+ DataTimePicker1 - & gt; The value + 'into' # DataTimePicker1 - & gt; Value# 'ok


Yes, the type to a DateTime field before and after the assignment should be combined with #

CodePudding user response:

With #

If it is more than 2007 version of office
Still have to install the latest odbc driver

  • Related