# Re: 用vb6写CGI程式,在写入ACCESS时,NT发生严重错误.....急

Posted by Roger Huang on July 10, 1997 at 21:44:17:

In Reply to: 用vb6写CGI程式,在写入ACCESS时,NT发生严重错误.....急 posted by tom on July 01, 1997 at 09:05:22:

: Dr.Watson 严重错误
: 无法附加于应用程式
: Windows NT错误码 87
: 能否请各位前辈告知小弟如何解决? 谢谢!

我用这支CGI有一段时间了,
也没什么问题.
或许你把值先存到变数再指定就可以了吧?!
对了, 我的database是在CGI_MAIN开的.
而不是在 DoGet() 或 DoPost 里开.

Sub DoPost()
Dim buf As Variant
Dim buf1 As Variant
Dim buf2 As Variant
Dim buf3 As Variant
Dim buf4 As Variant
Dim Fname, Fname1, SQLstring As Variant
Dim sql_statement As String

Select Case sSelector
Case "APPEND": ' 新增一笔资料
buf1 = GetSmallField("Name")
buf2 = GetSmallField("Sex")
buf3 = GetSmallField("Add")
buf4 = GetSmallField("Tel")
Set ds = Db.OpenRecordset("friend", dbOpenTable)
ds.AddNew
ds("Name") = buf1
ds("Sex") = buf2
ds("Add") = buf3
ds("Tel") = buf4
ds.Update
ds.Close
Send (""资料已加入资料库中")

Follow Ups: