本文介绍了帮助VB + SQL代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在VB代码中使用SQL代码并且我在第一个选择语句中不断收到预期案例错误,任何人都可以帮我这个吗?


谢谢


ConnectionString =" Provider = SQLOLEDB.1; server = wsus; Integrated Security = SSPI; Persist Security Info = False; Initial Catalog = inv_tracking"

set cn = CreateObject(" ADODB.Connection")

cn.Open ConnectionString

mStringSQL =" INSERT INTO driver_destroyed_log(emp_id,date_recieved,violation,form_manner, log_status,status_date,date_destroyed,comments,log_id)"


SELECT Driver_daily_logs.emp_id,Driver_daily_logs.date_recieved,Driver_daily_logs.violation,Driver_daily_logs.form_manner,Driver_daily_logs.log_status,Driver_daily_logs.status_date,Driver_daily_logs .date_destroyed,Driver_daily_logs.comments,Driver_daily_logs.log_id

FROM Driver_daily_logs

WHERE DATE()> date_destroyed;

CN.Execute(mStringSQL)

解决方案




I am trying to useSQL code inside VB code and I keep getting an Expected Case error on my first select statement, can any one help me with this??

Thanks

ConnectionString = "Provider=SQLOLEDB.1;server=wsus;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=inv_tracking"
set cn = CreateObject("ADODB.Connection")
cn.Open ConnectionString

mStringSQL ="INSERT INTO driver_destroyed_log ( emp_id, date_recieved, violation, form_manner, log_status, status_date, date_destroyed, comments, log_id )"

SELECT Driver_daily_logs.emp_id, Driver_daily_logs.date_recieved, Driver_daily_logs.violation, Driver_daily_logs.form_manner, Driver_daily_logs.log_status, Driver_daily_logs.status_date, Driver_daily_logs.date_destroyed, Driver_daily_logs.comments, Driver_daily_logs.log_id
FROM Driver_daily_logs
WHERE DATE()>date_destroyed;
CN.Execute (mStringSQL)

解决方案




这篇关于帮助VB + SQL代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 23:26