Results 1 to 14 of 14

Thread: SQL connection issue

  1. #1

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015

    SQL connection issue

    I have a painfully simple app I wrote for in-house use here at work, and it functioned perfectly until we swapped out the server housing the SQLserver DB. I changed the servername in the system DSN (and also tried creating a new one) on the station running the app (mine) but the app no longer makes connection. The DSN successfully connects according to the test, but the app crashes.

    Since the old server ran 2000 server, and the new one 2003 server, I thought perhaps there's an updating of provider required. Here's what I'm using:

    cnSPR.Provider = "Microsoft.Jet.OLEDB.4.0;"
    cnSPR.ConnectionString = "Provider=MSDASQL;DSN=SPR;"

    That worked fine, up until now. Any help appreciated.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: SQL connection issue

    Your provider is showing Access. Try this site for a complete listing of ADO / SQL connection strings.

    Connection String
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015

    Re: SQL connection issue

    Quote Originally Posted by RobDog888
    Your provider is showing Access. Try this site for a complete listing of ADO / SQL connection strings.

    Connection String
    Unfortunately, that didn't solve the problem either. There is a network/firewall issue afoot here, I'm sure of it. We tried to create a new system DSN using 2 different logins that are known to exist and be correct, yet both logins failed during the DSN creation process. Only using windows authentication, can we create a DSN, but that still doesn't allow us into the DB. Our network admin is working on it. Thanks for your reply!

  4. #4
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL connection issue

    A customer of mine just had this problem - upgrade from 2000 to 2003 would not allow links to the DB anymore.

    It was because they did not upgrade the server to MDAC 2.8 before the 2003 upgrade.

    This left multiple copies of .DLL's for MDAC in place - bad versions.

    There is a MSDN knowledge base article about it - it's more about EXCHANGE, but the same issue is related to SQL.

    Try searching MSDN for MDAC and 2003 - maybe that will work...

    I just searched and found this bit of bad news for you:

    No more JET in MDAC 2.6 and above

    Like RD asked - why are you not using the proper provider - you should use SQLOLEDB - make that change before you go any further.

  5. #5
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL connection issue

    Here's the KB article about upgrading a 2000 to 2003 server that has MDAC 2.7 on it.

    You'll find a problem with Oledb32.dll - check it out...

    MDAC problem with 2003 upgrade

  6. #6

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015

    Re: SQL connection issue

    You guys ROCK. I'm home now, but I'll check on that 1st thing tomorrow. Mille grazie, lads.

  7. #7
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: SQL connection issue

    DUNSEL ,

    Try this... Auto OS Updater

    This will update everything you need.

  8. #8
    New Member
    Join Date
    Dec 2004
    Posts
    1

    Re: SQL connection issue

    cnSPR.Provider = "Microsoft.Jet.OLEDB.4.0;"
    cnSPR.ConnectionString = "Provider=MSDASQL;DSN=SPR;"
    You set the Provider in two place WHY?

    Take the top one out!!!!!!

  9. #9

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015

    Re: SQL connection issue

    Yeah, the top one was commented out in the actual code. I also tried the correct SQL server provider, that made no difference either. I have to try what else was suggessted today.

  10. #10
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL connection issue

    If you have EXCEL on the machine, attempt to connect to DB with EXCEL.

    It's done under the IMPORT DATA, NEW DATA SOURCE, NEW SQL OLEDB connection (something like that).

    If you have a problem connecting with EXCEL, then forget about your program and fix the DLL problem that I've posted the MSDN links about.

    If you can connect with EXCEL, then the problem lies within your connection string.

  11. #11
    Lively Member
    Join Date
    Sep 2002
    Location
    Basingstoke
    Posts
    86

    Re: SQL connection issue

    Make sure you have port 1433 (used by MS-SQL Server) open on the new server. And maybe check you have upto date MDAC installed on server & client machines.

  12. #12

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015

    Re: SQL connection issue

    Well I can tell you that SQL enterprise manager connects with no trouble. I haven't had time yet to check with excel, or try any of the other suggestions yet. I was late today

  13. #13
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: SQL connection issue

    The upgrade of 2000 to 2003 fails if MDAC 2.7 is on the machine.

    That is a known issue - KB article posted earlier.

    ENTERPRISE MANAGER does not experience the problem.

    EXCEL will "reflect" the problem - if you choose SQLOLEDB connection method.

    Just went through all this with a customer last month - calls to MICROSOFT to get support help...

    Hope this helps.

  14. #14

    Thread Starter
    PowerPoster JPnyc's Avatar
    Join Date
    Oct 2002
    Location
    Manhattan
    Posts
    3,015

    Re: SQL connection issue

    Thanks for all the input folks. The old OS wasn't updated, but rather formatted and installed fresh. Further, the old server was retired completely and the new one had XP Pro loaded, prior to the reformat. I don't know if that abrogates any of the known issues described or not.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width