Hello all

I've been using it for years
SQL SERVER 2014 Standard and language
VB6 programming, but only this time
get the following error:

Run-time error '-2147467259 (80004005)':
[DBNETLIB][ConnectionWrite (WrapperWrite().]General network error

Has any of you guys ever experienced this??

what is this caused by??

thanks for the enlightenment

Regards,

Dani AI

Generated

This error is a generic DBNETLIB/ADO “socket write” failure — the client tried to send data to SQL Server and the network layer failed. Common root causes are intermittent network loss (NIC/driver, switch/router, VLAN), firewall or MAC-level blocking, the SQL service restarting or hitting resource limits, or an old network provider/driver misbehaving under current OS/patch levels. Given ’s environment (VB6 + ADO talking to SQL Server 2014 on Win7/Server2012), network-level problems are the most likely place to start.

Checklist to narrow the cause (run in this order):

  • Reproduce under the VB6 IDE, as suggested, so the exact failing line and local variables can be inspected. Note ADODB.Connection.State and Err.Number/Description.
  • Verify basic connectivity: continuous ping/tracert/tcping to the server and its SQL port (default 1433). Look for packet loss, high latency or route changes.
  • Confirm the server: check SQL Server service uptime, SQL error log and Windows Application/System event logs for connection resets, restarts, or resource exhaustion. Confirm TCP/IP is enabled for the instance.
  • Inspect firewalls/routers and switching: Windows Firewall, any perimeter device, and ACLs on the router. If the router blocks the server’s MAC address at layer 2, the server will be unreachable and this error will occur. Blocking only internet access while allowing LAN traffic requires ACLs or firewall rules that do not drop local frames.
  • Driver/provider and timeouts: old DBNETLIB/SQLOLEDB providers can fail intermittently. Try an updated client provider (SQL Native Client / modern OLE DB or ODBC driver) and increase connection/command timeouts or add retry logic.
  • Short-term mitigation: add a small reconnect/retry around critical operations and log every failure with timestamp, server reachable test, and local app state.

VB6 retry pattern (conceptual):

Dim attempts As Integer
attempts = 0
Do While attempts < 3
  On Error Resume Next
  cn.Open connStr
  If cn.State = adStateOpen Then Exit Do
  attempts = attempts + 1
  On Error GoTo 0
  ' brief pause before retry
Loop

Note: blocking a MAC on the router will stop network frames and can produce this exact symptom. Longer term, plan to move off unsupported VB6 components (as noted) or standardize on a supported client driver to reduce surprises.

Recommended Answers

All 11 Replies

This is outside my wheelhouse but I did a Google search and came across the following article on Microsoft's website about the issue: https://learn.microsoft.com/en-us/office/troubleshoot/excel/run-time-error-2147467259-80004005

The thing is though, that my Google search is also showing a lot of other articles each saying the problem is caused by all sorts of different things. In conclusion, I really wish I could help you, but you will probably need to wait for someone else to post here who has more experience with MSSQL.

While I can answer yes, you may not like my answer. VB6 was getting too expensive to keep up. Fixes too longer, workarounds kept getting more and more arcane and the client didn't like the pricing.

Finally we reached that tipping point where we moved up to VB.Net. Took a few months but out last VB6 app is officially dead.

But if the client wanted to run it on Windows XP to 7, it still works but their company policy is W10/11 everywhere so the app had to be upgraded.

Sorry, I don’t understand what you’re saying? Are you insinuating that the error they are getting is because they are running an older version of Windows? Because they’re also running an older version of VB and SQL, so why wouldn’t all 3 work together?

I’m confused about how your little anecdote about your company upgrading from VB6 is relevant to the error code.

Dani,

The old app was in VB6, ran for decades with minor revisions until Windows 10. We found work arounds but as Microsoft issued more OS updates it would break in very strange ways. Finally the cost (time is money) was getting to be too expensive. We didn't mind continuing but the cost to maintain legacy systems at some point means it's time to move on.

I see no need to open the old bug logs and look up exact errors we saw or the fixes we found. VB6 is unsupportable on Windows 10 and 11 today. Also, yes, we used SQL for this system.

To rproffitt's point, fx.eko, what operating system are you running? Do other VB6 apps run perfectly fine on it? Have you ever experienced any issues like this before? Did Windows Update recently run and perhaps upgrade something that broke VB6?

My view is that VB6's time passed years ago.

I agree that VB6's time passed many years ago, although I have a soft spot for it as it was one of my first programming languages. (I went from BASIC on an Apple IIGS when I was 4 years old, to QBASIC when I was 10 or 11, to Visual Basic 4 and then VB6 when I was 12/13ish. I think that timelines is about right, although don't quote me on it :)

But to go back to fx.eko's question, did the Microsoft article I linked you to yesterday help at all?

Good luck!

hi the link you provided didn't help me, the operating system that I use is Win 7 Professional and Win Server 2012 standard and SQL 2014 standard, indeed the VB6 programming language is a bit behind, but in migrating the system of course the old system is still running, can't just cut off, while the process of developing to VB.Net is not finished

Regards,

That error can be caused by non-code related issues. Such as a network issue, the server not responding and more.

As the VB6 app author you would repeat the error while the app is running in the Visual Studio development system so you can examine the code and variables on the failing line. Maybe you'll see why, IF it's code related. But given a network or server issue can cause it, you may have to consider replacing hardware that is past its prime.

I've run into this more than a few times with legacy systems that started to go unstable. Perils of running old gear.

is it possible that this is caused by blocking the mac address on the router from the lan card, because I don't want the server to be connected to the internet

commented: Easy to test. Don't do that. +17

I have usually see the server time out errors most of the time at my client website, what is the issue behind it?

commented: Confusing post. Is this a question for fx.eko or a new question from you. If so, open a post of your own please. +15

I've been using it for years
SQL SERVER 2014 Standard and language
VB6 programming, but only this time
get the following error:
Run-time error '-2147467259 (80004005)':
[DBNETLIB][ConnectionWrite (WrapperWrite().]General network error

Has any of you guys ever experienced this??

Yes, I have experienced this error before. It is caused by a problem with the network connection between your computer and the SQL Server database.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.