Mag-aral online!
Access Expert125x125
Cheap Web Hosting at 1.99 USD a month!

Online Advertising

Online Advertising

Online Advertising

Online Advertising







Database

Mysql in visual basic Sample Source Code

  1. 'Here I create a variable named MySQL as a new connection object for MySQL
  2. Global MySQL As New MySQL_CONNECTION
  3.  
  4. Private Function MySQL_Connect() As Boolean
  5. Dim res_MySQL As MYSQL_CONNECTION_STATE
  6.  
  7. MySQL_Connect = False
  8. res_MySQL = MySQL.OpenConnection("server", "username", "password", "database", 3306, CLIENT_COMPRESS)
  9.  
  10. If res_MySQL = MY_CONN_OPEN Then
  11. MySQL_Connect = True
  12. End Function
  13.  
  14. ' Query -> MySQL query to execute.
  15. ' CloseRS -> Optional. Close recordset created after executing Query.
  16. ' RS -> Optional. Reference to externaly created variable, declared as MYSQL_RS. If not closed, it will be available to the program after the query is executed.
  17. ' lAffected -> Optional. Numer of rows affected after te Query.
  18. Public Sub SQLQuery(ByVal Query As String, Optional ByVal CloseRS As Boolean = False, Optional ByRef RS As MYSQL_RS, Optional ByRef lAffected As Long)
  19. Dim ERR As MYSQL_ERR
  20.  
  21. Set RS = MySQL.Execute(Query, lAffected)
  22. Set ERR = MySQL.Error
  23.  
  24. If ERR.Number <> 0 Then
  25. ' Handle any eventual errors that occurred during MySQL query
  26. End If
  27. ERR.Clear
  28. Set ERR = Nothing
  29.  
  30. If CloseRS Then
  31. RS.CloseRecordset
  32. Set RS = Nothing
  33. End If
  34. End Sub
  35. Continue reading...

Compact and Repair MS Access Database using ADO and JRO

Compact and Repair MS Access Database using ADO and JRO

This function uses the Microsoft Jet and Replication ObjectsLibrary (part of ADO) to compact and repair a Microsoft Accessdatabase. A project reference is required to the Microsoft Jetand Replication Objects Library.You may want to add error handling to this procedure, or tothe function that calls it as the compact and repair may fail,for instance, if exclusive access cannot be gained to thesource database.

Continue reading…


Implementing SQL Server 2005 Query Notifications in C# Windows Application

This item was filled under [ C#, Database, Programming ]

Query notification is a feature included in Microsoft SQL Server 2005 that allows applications to be notified when data has changed. It is mainly used for applications that stores cache of data from a database and get refreshed and notified in the client application everytime the data changes in the database. Continue reading…


SQL Server connection strings SQL ODBC connection strings

This item was filled under [ Database, General Programming, Programming, TIPS AND TRICKS ]

SQL Server connection strings

SQL ODBC connection strings


Standard Security:

“Driver={SQLServer};Server=Your_Server_Name;Database=Your_Database_Name;Uid=Your_Username;Pwd=Your_Password;”

Trusted connection:

“Driver={SQLServer};Server=Your_Server_Name;Database=Your_Database_Name;Trusted_Connection=yes;”

Continue reading…


MS Access connection strings MS Access ODBC connection strings

This item was filled under [ Database, General Programming, Programming, TIPS AND TRICKS ]

MS Access connection strings

MS Access ODBC connection strings


Standard Security:
“Driver= {MicrosoftAccessDriver(*.mdb)};DBQ=C:\App1\Your_Database_Name.mdb;Uid=Your_Username;Pwd=Your_Password;”

Continue reading…


MySQL connection strings MySQL ODBC connection strings

This item was filled under [ Database, General Programming, Programming, TIPS AND TRICKS ]

MySQL connection strings

MySQL ODBC connection strings


Open connection to local MySQL database using MySQL ODBC 3.51 Driver
“Provider=MSDASQL; DRIVER={MySQL ODBC 3.51Driver}; SERVER= localhost; DATABASE=Your_MySQL_Database; UID= Your_Username; PASSWORD=Your_Password; OPTION=3″

Continue reading…


Oracle connection strings

This item was filled under [ Database, General Programming, Programming, TIPS AND TRICKS ]

Oracle connection strings

Oracle ODBC connection strings


Open connection to Oracle database using ODBC
“Driver= {Microsoft ODBCforOracle};Server=Your_Oracle_Server.world;Uid=Your_Username;Pwd=Your_Password;”

Continue reading…


Tagged with: [ ]