Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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:

Needs["DatabaseLink`"]
Needs["JLink`"];

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->
C:\Users\mkaplan\AppData\Roaming\Mathematica\
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?

share|improve this question
    
What that error message means is that is that database has not been defined. It should be a string, right now it's not. –  Pickett Jan 31 at 7:53
    
@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? –  Mitchell Kaplan Jan 31 at 12:02
    
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. –  Pickett Jan 31 at 13:32
    
@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. –  Mitchell Kaplan Jan 31 at 13:48
    
Oh sorry, WITHOUT any parameters... I thought that was your code. I've never used the GUI so I'm afraid I cannot help. –  Pickett Jan 31 at 14:13
show 1 more comment

1 Answer

up vote 1 down vote accepted

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):

C:\ProgramData\Mathematica

C:\Users\mkaplan\AppData\Roaming\Mathematica

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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