求大虾解答.~~~送分70,+刚才那张帖子的30.搞定后,一起结了.
这是另外张帖子
http://community.csdn.net/Expert/topic/4278/4278299.xml?temp=.5989038
求大虾解答.
下面的是我的文件. 出错主要是在 Server.mappath()这里
'====== form.aspx =====
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_ServerClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ServerClick
'建立实例
Dim ObjAddInfo As New Taojin.FormSqlCmd
'
ObjAddInfo.addinfo(StrUser.Value, UsrChgPay.Value, ReqChgPay.Value, _
TxtUsrInfo.Value, IntUsrCme.Value, IntReqCme.Value)
StrLabInFo.Text = "加入数据成功!"
End Sub
' ========= End ===========
' ============ FormSqlCmd 类文件 ===============
Public Class FormSqlCmd
Dim StrConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" ****'就这里不知道怎么写了。***
' Server.MapPath("data/Tj_data.mdb") 应该放哪儿?
Dim ObjConn As OleDb.OleDbConnection = New OleDb.OleDbConnection(StrConn)
Dim ObjCommand As New OleDb.OleDbCommand
'加入数据操作
Function addinfo(ByVal StrUser As String, ByVal StrUcp As String, ByVal StrRcp As String, _
ByVal StrTxt As String, ByVal IntUsrCme As String, ByVal IntReqCme As String)
Dim Sql As String = "insert into TxtInformation Values('" + StrUser + "','" + StrUcp + "','" + StrRcp + "','" + StrTxt + "','" + IntUsrCme + "','" + IntReqCme + "')"
ObjConn.Open()
ObjCommand.Connection = ObjConn
Try
ObjCommand.CommandText = Sql
ObjCommand.ExecuteNonQuery()
Catch ex As Exception
Return False
End Try
End Function
Sub FormSqlCmd(ByVal StrConn As String) '初始化
End Sub
End Class
================ End ======================
麻烦各位大虾帮忙看看了.