I used to be able to connect to a SQL Server database. I haven't run this program for a few months. I tried it today and it failed, so I went back to try OpenSQLConnection[] and got the following error:

StringJoin::string: String expected at position 2 in server:1433/<>database.

I began my program with:


I tried to connect to my database anyway, but that returned:

OpenSQLConnection[JDBC[Microsoft SQL Server(jTDS),
server:1433/ <> database],  "Catalog" -> TOA_DW,
Description -> The reinsurance data warehouse.  Connection
created on September 5, 2013., Location->
DatabaseResources\warehouse.m, Name -> warehouse, 
Password ->  , Properties -> {}, 
ReadOnly -> False, RelativePath -> False, Timeout -> Automatic,
TransactionIsolationLevel -> ReadUncommitted, 
UseConnectionPool -> False, Username -> , Version -> 2.]

When I ran SQLConnections[] I got nothing.

Then I tried to connect to the demo database. Got the same initial error when I executed OpenSQLConnection[]. I manually tried to connect to demo through the UI and got a bunch more of the same "StringJoin" errors. However when I ran SQLConnections[] I did get:

{SQLConnection["demo", 1, Open, TransactionIsolationLevel -> ReadCommitted]}

Which I think means that it connected.

There have been some changes to permissions that were put into place since the last time I ran this successfully. However OpenSQLConnections[] isn't specifying anything, so I wonder why I got that initial "StringJoin" error. Also, I can connect to my database using the SQL Management Studio.

Can anyone suggest where to start looking for the problem?

  • $\begingroup$ What that error message means is that is that database has not been defined. It should be a string, right now it's not. $\endgroup$
    – C. E.
    Commented Jan 31, 2014 at 7:53
  • $\begingroup$ @Pickett - I thought that by entering OpenSQLConnection without any parameters I could enter the database through the resultant UI. Then I would save it as a connection along with the database server, and various other parameters. What am I missing? $\endgroup$ Commented Jan 31, 2014 at 12:02
  • $\begingroup$ You haven't shared the code that defines database so I can't tell you what's wrong, but for some reason it's not a string and so StringJoin throws that error. $\endgroup$
    – C. E.
    Commented Jan 31, 2014 at 13:32
  • $\begingroup$ @Pickett - I haven't defined "database" anywhere. I assume that you're referring to a constant called "database" that I should have assigned a value to? I'm not using anything called database. Am I misunderstanding you? Also, the code that worked a few months ago is untouched and doesn't work now. I must be misunderstanding. $\endgroup$ Commented Jan 31, 2014 at 13:48
  • $\begingroup$ Oh sorry, WITHOUT any parameters... I thought that was your code. I've never used the GUI so I'm afraid I cannot help. $\endgroup$
    – C. E.
    Commented Jan 31, 2014 at 14:13

1 Answer 1


My problem was solved by Wolfram support. Apparently there was some corruption in one or more Mathematica files. We solved the problem by deleting the following folders (Windows 7, 64 bit):



When I then ran Mathematica, it recreated these folders and the error went away.

  • $\begingroup$ This solved my issue as well. I did have to reactivate when I started the program after deleting the directories so make sure you have your activation key handy. $\endgroup$ Commented Aug 29, 2019 at 22:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.