Friday, February 17, 2012

dbnetlib.dll ?

What is the meaning of "Can't find PInvoke DLL, dbnetlib.dll"?

I got this error message when trying to access the server, I'm developing SQL Mobile app.

How to solve this problem?

thx

I have two apps, with the same code on both app :

Dim ConnStrToServer As String = "Data Source=myIP,1433;Initial Catalog=mydatabase;User ID=sa;Password=;"

Dim connection As New SqlConnection(ConnStrToServer)

connection.Close()

MsgBox("This will take a minute")

Try

connection.Open() -->> ERROR!!

Dim queryString As String = _

"Update mytable set flag='PESAN'" & _

", username='" & tbIdNumber.Text.Trim & "'" & _

", tglpenyerahan='" & Now & "'" & _

" Where KodeProyek='" & kodeProyek.Trim & "' And NoKavling='" & NoKavling.Trim & "'"

Dim adapter As SqlDataAdapter = New SqlDataAdapter( _

queryString, connection)

Dim mstmap As New DataSet

adapter.Fill(mstmap, "mytable")

connection.Close()

Catch ex As Exception

MsgBox(ex.Message)

End Try

the different is the first app is a SQL Mobile app, now when I try to open a connection from the first app is always shows that error with the above code (eventhough my replication not error), but when I try to execute (success open connection) the query with the second app (not SQL Mobile app) works!

dbnetlib.dll is a library that is part of Windows MDAC (http://msdn.microsoft.com/data/learning/MDAC/). It is the layer that implements network connectivity (e.g. TCP/IP, named pipes, etc.) in communicating with the database server. MDAC ships as part of Windows.

Based on the error you are seeing it sounds like dbnetlib.dll is either not present on the OS or not being located.

You might try taking a look at this page that has links to programming applications for SQL Mobile: http://msdn2.microsoft.com/en-us/library/ms174113.aspx.

Hope this helps,

Vaughn

No comments:

Post a Comment