# Re: 关于资料存取修改

Posted by Musa on November 28, 1998 at 22:21:18:

In Reply to: Re: 关于资料存取修改 posted by ChenNet on November 26, 1998 at 10:52:30:

: 使用Mid:
: Mid(X,n,m)=Y
: 以Y替换X第n个字元起的m个字元

这是我做的 '查询' 功能之一部份, 但是我现在想做的是自 TextBox 抓一个书号并到资料库中删除整笔记录, 请问您说的语法应如何应用 ?
sqlstr = "INSERT INTO 查询结果 " ' 暂存档
sqlstr = sqlstr + " SELECT 书名, 书别, 书号, 书价, 书等, 购买日期, 是否成套, 其他成员, 书评"
sqlstr = sqlstr + " FROM 图书档 "
Select Case cboSpe.ListIndex
Case -1
Case 0
Rnkey$ = "C - "
Case 1
Rnkey$ = "H - "
Case 2
Rnkey$ = "M - "
End Select
sqlstr = sqlstr + " WHERE 书号 LIKE '" + Trim$(Rnkey$) + "*'"
'执行 SQL 指令
DA.Execute sqlstr
'撷取查询结果
Set TB = DA.OpenRecordset("SELECT * FROM 查询结果", dbOpenDynaset)
TB.Requery
Musa

Follow Ups: