如何在Ms-Access中编写存储过程 [英] How to write Storedprocedures in Ms-Access

查看:128
本文介绍了如何在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


这篇关于如何在Ms-Access中编写存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆