vb无法使用odbc连接到mysql [英] vb cannot connect to mysql using odbc
本文介绍了vb无法使用odbc连接到mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在vb中有一个digitalpersona sdk示例,我想将其后端发送到mysql但我的第一个问题是我无法连接或者它在连接到mysql时出错,我的odbc连接没问题,当我使用代码时连接到其他vb项目其连接和确定,但当我在digitalpersona的示例sdk中使用它时,它在连接时出错,
这里是我的代码:< br $> b $ b
i have a digitalpersona sdk sample in vb, i want to make its backend to mysql but my 1st problem is i cant connect or it gives an error in connecting to mysql, my odbc connection is ok, and when i use the code for connecting to other vb project its connected and ok, but when i use it in sample sdk of digitalpersona, it give an error in connecting,
here's my code:
Imports System.Data.Odbc
Delegate Sub FunctionCall(ByVal param)
Public Class MainForm
Dim sql As String
Private con As New OdbcConnection("DSN=db")
Dim cmd As OdbcCommand = Nothing
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
con.Open()
Catch ex As Exception
MsgBox("Error Creating DB Connection")
End Try
End Sub
在您的帮助中提前感谢。
thanks in advance in your help.
推荐答案
检查出来:使用VB.NET连接到MySQL数据库 [ ^ ]
这篇关于vb无法使用odbc连接到mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文