问题描述
大家好。我是这个小组的新手,我正在研究我的第一个真正的VB.Net
项目。我在创建和存档数据库时遇到了麻烦。我们使用
一个Access数据库存储来自我们仪器的结果,需要
让我们的客户能够存档他们的结果并修剪
来自主数据库的归档数据。
此查询字符串在.Net中工作,连接字符串定义为
指向父数据库。
" insert into .. \ myArchive.Results select * from Results where" &
queryString
这不起作用:
" insert into" &安培; strPath& " \ myArchive.Results select * from Results
where" &安培; queryString
在这种情况下,strPath是父数据库的完整路径,与连接字符串中定义的相同。
。在这两种情况下,queryString
是相同的。我得到的错误是不完整的查询条款。但唯一的
差异是归档数据库的路径。顺便说一下,这两条路径都指向相同的数据库文件。
我真的需要能够使用父数据库的路径来设置
存档的路径。有什么想法吗?
谢谢
-
Steve Kelley
只是一个猜测,但路径是否包含空格?
您可能需要在表名周围加上引号。
只是一个猜测,但路径是否包含空格?
您可能需要在表名周围加上引号。
Hello all. I''m new to this group and I''m working on my first real VB.Net
project. I''m having trouble creating and archive of a database. We use
an Access database to store results from our instruments and need to
give our customers the ability to archive their results and prune the
archived data from the main database.
This query string works in .Net with the connection string defined to
point to the parent database.
"insert into ..\myArchive.Results select * from Results where " &
queryString
This does not work:
"insert into " & strPath & "\myArchive.Results select * from Results
where " & queryString
In this case strPath is the full path to the parent database and is the
same as is defined in the connection string. In both cases queryString
is the same. The error I get is "Incomplete query clause" but the only
difference is the path to the archive database. BTW, both paths point to
the same database file.
I really need to be able to use the path to the parent database to set
the path to the archive. Any ideas?
Thanks
--
Steve Kelley
Just a guess, but does the path contain spaces?
You may need to put quotes around the table name.
Just a guess, but does the path contain spaces?
You may need to put quotes around the table name.
这篇关于插入问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!