Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-03-07 : 07:47:01
|
| Hugh writes "I have a VB 6 application that is inserting audit records into a SQL Server database. The same app is running on multiple user's machines and the database connectivity has been checked, however, some users audit records are successfully being inserted and some aren't. What can I look for? I don't appear to be getting an error. This is being done with the following code:On Error GoTo WriteAuditCleanup: If conAudit Is Nothing Then Set conAudit = New ADODB.Connection sConn = "Data Source = " & Trim(sODBC) & ";UID=" & Trim (sUID) & ";PWD=" & Trim(sPwd) conAudit.Open sConn End If conAudit.Execute sSQL WriteAuditRecord = TrueWriteAuditCleanup: If Not conAudit Is Nothing Then conAudit.Close Set conAudit = Nothing End If" |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-03-07 : 09:58:34
|
| It doesn't appear that you've wrapped the conAudit.Execute sSQL command in any type of error catching routine. I'm not a VB guy but doesn't that code say that if an error occurs just cleanup the connection? If an error occurs how are you reporting it? I'd guess that if it always works for some people and never works for others that it's an authentication problem. Have you checked the event log?Be One with the OptimizerTG |
 |
|
|
|
|
|