E
Eric Caron
Hi
I try to create a windows service to read content of my database at
each 60 minutes. I create my service, i put a timer and set it's
interval to 600000. This work good. My problem is that when I access
my database. It seem that I can't open my database. Hre's my code :
Dim myConnection As New OdbcConnection("DSN=pg_dem;USR=dba;PWD=tom")
Dim myQuery As String = "SELECT * FROM GL_ANNU WHERE no_gl='121110000'
Dim myCommand As New OdbcCommand(myQuery, myConnection)
Try
myConnection.Open()
'Dim myReader As OdbcDataReader
'myReader = myCommand.ExecuteReader()
'EventLog.WriteEntry("Lecture des données effectuées avec succès.")
Catch ex As Exception
'EventLog.WriteEntry("Erreur de base de données.")
'Finally
'EventLog.WriteEntry("Fermeture de la base de données.")
myConnection.Close()
End Try
What is my problem ?
Thanks
I try to create a windows service to read content of my database at
each 60 minutes. I create my service, i put a timer and set it's
interval to 600000. This work good. My problem is that when I access
my database. It seem that I can't open my database. Hre's my code :
Dim myConnection As New OdbcConnection("DSN=pg_dem;USR=dba;PWD=tom")
Dim myQuery As String = "SELECT * FROM GL_ANNU WHERE no_gl='121110000'
Dim myCommand As New OdbcCommand(myQuery, myConnection)
Try
myConnection.Open()
'Dim myReader As OdbcDataReader
'myReader = myCommand.ExecuteReader()
'EventLog.WriteEntry("Lecture des données effectuées avec succès.")
Catch ex As Exception
'EventLog.WriteEntry("Erreur de base de données.")
'Finally
'EventLog.WriteEntry("Fermeture de la base de données.")
myConnection.Close()
End Try
What is my problem ?
Thanks