VBでMySql.Data 0x80004005 Parameter @ must be defined.のエラー

2018年2月20日火曜日

MySQL VBプログラミング

t f B! P L
VBからMySQLの操作で、SQL文の中でパラメータの渡しがあるときにエラーになる。
MySQL.dataのエラー。



0x80004005 Parameter @ must be definedのようなエラー。


この解決法

Dim Cnnstr As String

' データベースへ接続するための接続文字列
Cnnstr = "Server= localhost;UserID=ユーザー;Password=パスワード;database=database;Allow User Variables=True"

'コネクション確立


Cnn = New MySqlConnection(Cnnstr)


赤文字を追加して接続すると解決する。

検索

年月ごとアーカイブ

フレンドブログ

Translate

自己紹介

自分の写真
映画が好き! 音楽好き! 演奏も好き! ミキシングが一番好き!

QooQ