在ms访问中存储数据时遇到问题 [英] Having problem in storing data in ms access
本文介绍了在ms访问中存储数据时遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
string str = 插入联系人(file_no,full_name,指定,部门,company_name,contact_type,类别,街道,城市,密码,assistant_name,ph_home,ph_mobile,ph_bus_office,ph_bus_res,fax,email_id,网站)值( + textBox17.Text + ', + ' + textBox1.Text + ' , + ' + textBox2.Text + ', + ' + textBox3.Text + ', + ' + textBox4.Text + ', + ' + textBox5.Text + ' , + ' + textBox6.Text + ', + ' +地址+ ', + ' + textBox9.Text + ', + ' + textBox10.Text + ', + + textBox13.Text + ', + ' + textBox19.Text + ', + ' + textBox20.Text + ', + ' + textBox21.Text + ', + ' + textBox22.Text + ', + ' + textBox23.Text + ', + ' + textBox14.Text + ', + ' + textBox15.Text + < span class =code-string> ');
我得到了查询语句中缺少语法错误。
请帮我解决这个问题。
解决方案
你的价值观需要一个(') :
string str = < span class =code-string> insert into contact(file_no,full_name,designation,department,company_name,contact_type,categories,street,city,pincode,assistant_name,ph_home,ph_mobile,ph_bus_office,ph_bus_res,fax,email_id,website)value (' + ...
可以使用访问数据修复工具读取MS Access数据
阅读下一个解决方案 http://www.access.repairtoolboxx.com
string str = "insert into contact(file_no, full_name, designation, department, company_name, contact_type, categories, street, city, pincode, assistant_name, ph_home, ph_mobile, ph_bus_office, ph_bus_res, fax, email_id, website) values(" + textBox17.Text + "'," + "'" + textBox1.Text + "'," + "'" + textBox2.Text + "'," + "'" + textBox3.Text +"'," + "'" + textBox4.Text + "'," + "'" + textBox5.Text + "'," + "'" + textBox6.Text + "'," + "'" + address + "'," + "'" + textBox9.Text + "'," + "'" + textBox10.Text +"'," + "'" + textBox13.Text + "'," + "'" + textBox19.Text + "'," + "'" + textBox20.Text + "'," + "'" + textBox21.Text + "'," + "'" + textBox22.Text + "'," + "'" + textBox23.Text +"'," + "'" + textBox14.Text + "'," + "'" + textBox15.Text + "')";
I am getting error as syntax is missing in query statement.
Please help me resolve this thing.解决方案You need a (') after your values:
string str = "insert into contact(file_no, full_name, designation, department, company_name, contact_type, categories, street, city, pincode, assistant_name, ph_home, ph_mobile, ph_bus_office, ph_bus_res, fax, email_id, website) values('" + ...
MS Access data can be read by using of access data repair tool
Read next solution http://www.access.repairtoolboxx.com
这篇关于在ms访问中存储数据时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文