Stored Procedure
am 22.03.2006 10:00:04 von Michael Louie Loria
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hello,
Does anybody have sample code for calling a stored procedure and
function in VB?
Thanks,
Michael Louie Loria
LoRz Technology Solutions
http://ww.lorztech.com
-----BEGIN PGP SIGNATURE-----
Comment: GPG Public Key: https://www.biglumber.com/x/web?qs=0x4A256EC8
Comment: GPG Public Key: http://www.lorztech.com/GPG.txt
Comment: Google, Skype, Yahoo ID: michaellouieloria
iQEVAwUBRCESFLXBHi2y3jwfAQotfggAqPayIKkfZpMk+259eSQ32/CJLG4X FAeB
UHgWQRBFEIL5E1MZxo8FJ1ZNgbuV9jmFV52kLV6nJVvRH59Lpc4EzPZ2uP/w 41oq
9w2uHUnYEWFiJwYDkN0eiYdvAR3PcYBET5RxgbodVpoerg8xTDSYjOr/TwiX 0XcH
gWQ4tVqMA8xgtvG2TSHDuekdb5xLvSbtaN2iJLReMTJlE/4kPyNl2oZ71eae 8KWQ
7cI7nIWwePvPCUKKVTZX/4cZbzr4LhJd+ykraxgMLIImbt0piWDCWUWDkvzD OYk5
kajklVznCKy1Tp59ZK3fe5wv7EVv8tcUtwNj66DsBboVP3eQrGUubA==
=xk7a
-----END PGP SIGNATURE-----
--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org
Re: Stored Procedure
am 22.03.2006 10:21:28 von rn
This might help :
http://www.vb-helper.com/howto_access_stored_procedure.html
************************************************************ ****************
Denne mail er blevet scannet af http://www.comendo.dk og indeholder ikke virus!
************************************************************ ****************
--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc@m.gmane.org
RE: Stored Procedure
am 22.03.2006 15:05:39 von mhoover
If you are looking to call a sp that returns results, here is some code.
I tied it to the on format event in a report (MS Access 2000).
Dim strClientID As String
Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim sqlClientNotes As String
strClientID =3D Me.ClientID
sqlClientNotes =3D "Call spClientNotes2('" & strClientID & "');" 'Set =
the
connection string and open a connection Set conn =3D
CreateObject("ADODB.Connection") conn.Open strConnect
'Populate the ClientNotes
cmd.CommandText =3D sqlClientNotes
cmd.ActiveConnection =3D conn
rs.CursorLocation =3D adUseClient
rs.Open cmd, , adOpenKeyset, adLockReadOnly, adCmdText
With rs
If Not .EOF Then
Me.txtClientNotes =3D rs("NtClientNotes").Value
End If
End With
rs.Close
conn.Close
-----Original Message-----
From: Michael Louie Loria [mailto:mlloria@lorztech.com]=20
Sent: Wednesday, March 22, 2006 4:00 AM
To: myodbc@lists.mysql.com
Subject: Stored Procedure
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hello,
Does anybody have sample code for calling a stored procedure and
function in VB?
Thanks,
Michael Louie Loria
LoRz Technology Solutions
http://ww.lorztech.com
-----BEGIN PGP SIGNATURE-----
Comment: GPG Public Key: https://www.biglumber.com/x/web?qs=3D0x4A256EC8
Comment: GPG Public Key: http://www.lorztech.com/GPG.txt
Comment: Google, Skype, Yahoo ID: michaellouieloria
iQEVAwUBRCESFLXBHi2y3jwfAQotfggAqPayIKkfZpMk+259eSQ32/CJLG4X FAeB
UHgWQRBFEIL5E1MZxo8FJ1ZNgbuV9jmFV52kLV6nJVvRH59Lpc4EzPZ2uP/w 41oq
9w2uHUnYEWFiJwYDkN0eiYdvAR3PcYBET5RxgbodVpoerg8xTDSYjOr/TwiX 0XcH
gWQ4tVqMA8xgtvG2TSHDuekdb5xLvSbtaN2iJLReMTJlE/4kPyNl2oZ71eae 8KWQ
7cI7nIWwePvPCUKKVTZX/4cZbzr4LhJd+ykraxgMLIImbt0piWDCWUWDkvzD OYk5
kajklVznCKy1Tp59ZK3fe5wv7EVv8tcUtwNj66DsBboVP3eQrGUubA==
=3Dxk7a
-----END PGP SIGNATURE-----
--=20
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe:
http://lists.mysql.com/myodbc?unsub=3Dmhoover@gpwlaw-mi.com
--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=3Dgcdmo-myodbc@m.gmane.o rg
Re: Stored Procedure
am 23.03.2006 06:36:37 von Michael Louie Loria
--------------enig85A45313963593BCA720BACF
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
=============3D
Dim rs As New ADODB.Recordset
rs.Open "call spCreateDailyLog();", gstrConn, adOpenForwardOnly,
adLockOptimistic
Set rs =3D Nothing
=============3D
was successful
=============3D
Dim cmd As New ADODB.Command
cmd.ActiveConnection =3D gstrConn
cmd.CommandType =3D adCmdStoredProc
cmd.CommandText =3D "spCreateDailyLog"
cmd.Execute
=============3D
resulted to an error
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '{ call
spCreateDailyLog }' at line 1
What is missing in my ADODB command? The SP does not have any IN or OUT
parameter.
Michael Louie Loria
LoRz Technology Solutions
http://www.lorztech.com
Matthew L. Hoover wrote:
> If you are looking to call a sp that returns results, here is some code=
> I tied it to the on format event in a report (MS Access 2000).
>=20
> Dim strClientID As String
> Dim conn As New ADODB.Connection
> Dim cmd As New ADODB.Command
> Dim rs As New ADODB.Recordset
> Dim sqlClientNotes As String
>=20
> strClientID =3D Me.ClientID
> sqlClientNotes =3D "Call spClientNotes2('" & strClientID & "');" 'Set t=
he
> connection string and open a connection Set conn =3D
> CreateObject("ADODB.Connection") conn.Open strConnect
>=20
> 'Populate the ClientNotes
> cmd.CommandText =3D sqlClientNotes
> cmd.ActiveConnection =3D conn
> rs.CursorLocation =3D adUseClient
> rs.Open cmd, , adOpenKeyset, adLockReadOnly, adCmdText
> With rs
> If Not .EOF Then
> Me.txtClientNotes =3D rs("NtClientNotes").Value
> End If
> End With
> rs.Close
> conn.Close
>=20
> -----Original Message-----
> From: Michael Louie Loria [mailto:mlloria@lorztech.com]=20
> Sent: Wednesday, March 22, 2006 4:00 AM
> To: myodbc@lists.mysql.com
> Subject: Stored Procedure
>=20
>=20
> Hello,
>=20
> Does anybody have sample code for calling a stored procedure and
> function in VB?
>=20
> Thanks,
>=20
> Michael Louie Loria
> LoRz Technology Solutions
> http://ww.lorztech.com
--------------enig85A45313963593BCA720BACF
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Comment: GPG Public Key: https://www.biglumber.com/x/web?qs=0x4A256EC8
Comment: GPG Public Key: http://www.lorztech.com/GPG.txt
Comment: Google, Skype, Yahoo ID: michaellouieloria
iQEVAwUBRCIz67XBHi2y3jwfAQomSQgAi6XlcYHcL8Qa87vuvV0XKFRpF/zJ 3eGZ
xK/0qgVLI230b4MLJd82ur8VA+pfd6w2KnTAKmRPKznz+mtgqlbdrlVloy5e 0yV2
qZKUmocr2JdNiwibVWkP6B/VEzmPdqjsvMcXAzgVMKUd7W+kXH5v07kS3ZQ/ iVJx
2WByjtSCABk9lA+sUG/cpD86aswdEIxk2sq8/tS6/tfo8Ir268jHBp8viFu7 Jkb6
NVVPjbhwo9smiZWxF/LjVC37zu17oqj4jr5P4/E47JhqyzHOH+WMzwOOzI4B lHBy
AJBYXbN6CabjCTXCgqWMms14pOJOqJVsN7sO5EejyCPHMRSsQmuVVg==
=ybAc
-----END PGP SIGNATURE-----
--------------enig85A45313963593BCA720BACF--