如何在Ms-Access中编写存储过程
问题描述:
如何在Ms-Access中编写存储过程以及如何在Windows vb.net应用程序中调用它们
在此先感谢
Sucharitha
Hi,
How to write Storedprocedures in Ms-Access and how to call them into windows vb.net application
Thanks in Advance
Sucharitha
答
访问中没有任何存储过程.您可以在访问模块中编写VBA函数,然后从vb.net调用它们.
请参考这些链接..
http://www.dreamincode.net/forums/topic/78577-call -vba-function-in-vbnet/ [ http://bytes.com/topic/visual-basic-net/answers/359007-calling-vba-net [ ^ ]
http://forumi9.com/Question/call-vba-function-csharp-686.aspx [^ ]
http://stackoverflow.com/questions/4133094/run-vba-code-from-网络应用程序 [^ ]
There is no stroed procedure in access. You could write VBA functions in the module of access and call them from vb.net
Please refer these links..
http://www.dreamincode.net/forums/topic/78577-call-vba-function-in-vbnet/[^]
http://bytes.com/topic/visual-basic-net/answers/359007-calling-vba-net[^]
http://forumi9.com/Question/call-vba-function-csharp-686.aspx[^]
http://stackoverflow.com/questions/4133094/run-vba-code-from-net-applications[^]
Access中的存储过程称为查询,您可以像其他任何存储过程一样调用它.
A stored procedure in Access is called a Query and you call it just like any other stored procedure.
Dim cmd As OleDbCommand = New OleDbCommand()
Dim sConStr As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db1.mdb"
Dim conn As OleDbConnection
conn = New OleDbConnection(sConStr)
cmd.Connection = conn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "yourqueryname"
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
参见
http://www.stardeveloper.com/articles/display.html?article=2001050101& page = 1 [ ^ ]
http://msaccessmemento.hubpages.com/hub/Stored_Procedure_in_MS_Access [ http://devcity.net/Articles/18/msaccess_sp.aspx [
See
http://www.stardeveloper.com/articles/display.html?article=2001050101&page=1[^]
http://msaccessmemento.hubpages.com/hub/Stored_Procedure_in_MS_Access[^]
http://devcity.net/Articles/18/msaccess_sp.aspx[^]
using (OleDbConnection conn = new OleDbConnection(ConnString))
{
using (OleDbCommand cmd = new OleDbCommand(SqlString, conn))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("FirstName", txtFirstName.Text);
cmd.Parameters.AddWithValue("LastName", txtLastName.Text);
conn.Open();
cmd.ExecuteNonQuery();
}
}
大家好,
我已经在ms-access中编写了参数化查询.
谁能告诉我,如何在Windows vb.net中调用该查询
___Query
Hi All,
i have wrote parameterized query in ms-access.
can any one tell me that, how can i call that query in windows vb.net
___Query
UPDATE Wsr_UserDetails SET Wsr_UserDetails.[Password] = [Pwd]
WHERE (((Wsr_UserDetails.UserId)=[Uid]));
-----------
预先感谢
-----------
Thanks in advance