访问和GUID列类型 [英] Access and GUID Column Type
问题描述
我在代码中使用字段KeyId创建了一个访问数据库表。作为
GUID类型。更新与此GUID匹配的记录的SQL语法是什么,
即
将myGUid调暗为新GUID(....)
mySQL =" UPDATE ITEMS SET Title =" New Record No. 1",WHERE KeyID = myGUID)
上面当然会尝试匹配KeyID字段值的值为
" myGUID"
任何帮助都将不胜感激。
-
Dennis in Houston
Dennis写道:mySQL =" UPDATE ITEMS SET Title =" ;新记录第1号,在哪里KeyID =
myGUID
尝试:
\\\
mySQL =" UPDATE ITEMS SET Title =''New Record No.1''Hey键Key =''" &
myGUID&"''"
///
(对不起,如果换行,它应该都在一条线上)。注意使用
引号 - 单引号来分隔SQL语句中的字符串,
围绕GUID的单引号,以及双引号来结束文字字符串
允许插入myGUID变量内容。
希望有所帮助,
-
(O)enone
除了Oenone评论我会用newguid用于创建
网格。
将myGUid调暗为GUID = GUID.NewGuid
http://msdn.microsoft.com /library/de...wguidtopic.asp
Ken
--------------- -------
" Dennis" <德**** @ discussions.microsoft.com>在消息中写道
新闻:ED ********************************** @ microsof t.com ...
我在代码中创建了一个访问数据库表,其字段为KeyId。作为
GUID类型。更新与此GUID匹配的记录的SQL语法是什么,
即
将myGUid调暗为新GUID(....)
mySQL =" UPDATE ITEMS SET Title =" New Record No. 1",WHERE KeyID = myGUID)
上面当然会尝试匹配KeyID字段值的值为
" myGUID"
任何帮助都将不胜感激。
-
丹尼斯在休斯顿
没有编译......错误是操作员''&''没有为字符串定义或者
system.GUID
-
Dennis in Houston
" Oenone"写道:
丹尼斯写道:mySQL =" UPDATE ITEMS SET Title =" New Record No. 1",WHERE KeyID =
myGUID)
尝试:
\\\
mySQL =" UPDATE ITEMS SET Title =''新纪录1号''在哪里KeyID =''" &
myGUID&"''"
///
(对不起,如果包装,它应该都在一行)。注意使用
引号 - 用单引号分隔SQL语句中的字符串,单引号围绕GUID,双引号结束文字字符串
以允许myGUID变量要插入的内容。
希望有所帮助,
-
(O)enone
>
I have created an access database table in code with the field "KeyId" as a
GUID type. What is the SQL syntax for updating a record matching this GUID,
i.e.,
Dim myGUid as New GUID(....)
mySQL = "UPDATE ITEMS SET Title="New Record No. 1", WHERE KeyID = myGUID)
The above of course tries to match the KeyID field value with the value
"myGUID"
Any help would be appreciated.
--
Dennis in Houston
Dennis wrote:mySQL = "UPDATE ITEMS SET Title="New Record No. 1", WHERE KeyID =
myGUID)
Try:
\\\
mySQL = "UPDATE ITEMS SET Title=''New Record No. 1'' WHERE KeyID = ''" &
myGUID &"''"
///
(sorry if that wraps, it should all be on one line). Note the use of
quotation marks -- single quotes to delimit strings in the SQL statement,
single quotes around the GUID, and double-quotes to end the literal string
to allow the myGUID variable contents to be inserted.
Hope that helps,
--
(O) e n o n e
Hi,
In addition to Oenone comments I would use newguid to create the
grid.
Dim myGUid as GUID = GUID.NewGuid
http://msdn.microsoft.com/library/de...wguidtopic.asp
Ken
----------------------
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:ED**********************************@microsof t.com...
I have created an access database table in code with the field "KeyId" as a
GUID type. What is the SQL syntax for updating a record matching this GUID,
i.e.,
Dim myGUid as New GUID(....)
mySQL = "UPDATE ITEMS SET Title="New Record No. 1", WHERE KeyID = myGUID)
The above of course tries to match the KeyID field value with the value
"myGUID"
Any help would be appreciated.
--
Dennis in Houston
That doesn''t compile...Error is Operator ''&'' is not defined for string or
system.GUID
--
Dennis in Houston
"Oenone" wrote:
Dennis wrote:mySQL = "UPDATE ITEMS SET Title="New Record No. 1", WHERE KeyID =
myGUID)
Try:
\\\
mySQL = "UPDATE ITEMS SET Title=''New Record No. 1'' WHERE KeyID = ''" &
myGUID &"''"
///
(sorry if that wraps, it should all be on one line). Note the use of
quotation marks -- single quotes to delimit strings in the SQL statement,
single quotes around the GUID, and double-quotes to end the literal string
to allow the myGUID variable contents to be inserted.
Hope that helps,
--
(O) e n o n e
这篇关于访问和GUID列类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!