jfz2004
asked on
MATLAB SQL SERVER DATABASE CONNECTION
Hi,
I am using MATLAB R2011a (64bit) and try to connect to SQL SERVER but keep getting connection error. Should I use ODBC or JDBC. How to use them to connect?
Thanks.
Jennifer
I am using MATLAB R2011a (64bit) and try to connect to SQL SERVER but keep getting connection error. Should I use ODBC or JDBC. How to use them to connect?
Thanks.
Jennifer
I would use ODBC to connect to SQL Server. What's the error that you are facing?
ASKER
Thanks,
My ODBC is 64bit too. But I get this:
ans =
[Microsoft][ODBC Driver Manager] Invalid string or buffer length Please verify that login information and database url are valid.
My co-worker uses 32 bit for both MATLAB and ODBC driver and it works.
But I have to use 64 bit.
My ODBC is 64bit too. But I get this:
ans =
[Microsoft][ODBC Driver Manager] Invalid string or buffer length Please verify that login information and database url are valid.
My co-worker uses 32 bit for both MATLAB and ODBC driver and it works.
But I have to use 64 bit.
Looks like there is a general issue with Mathworks and 64-bit versions of the ODBC driver: http://www.mathworks.com/m atlabcentr al/newsrea der/view_t hread/3085 17
and
http://www.mathworks.com/m atlabcentr al/answers /93553-why -do-i-get- the-error- invalid-st ring-or-bu ffer-lengt h-when-usi ng-an-odbc -driver-wi th-the-dat abase (This 2nd link also contains a URL to the MatLab documentation for database connectivity).
and
http://www.mathworks.com/m
ASKER
Thanks. But the 2nd link does not allow me to access the answer. It requires a license number. I entered the license number, it says that license already has a user. So I am following JDBC. But it is so complex that it needs me to create a file called javalibrarypath.txt in a folder that does not even exist on my C:\ drive.
I am so frustrated.
I am so frustrated.
ASKER
According to MatLab's instruction, I need to 2 run the prefdir command in the MATLAB Command Window. The output of this command is a file path to a folder on your computer. But that folder is not on my computer C:\ drive.
Are you referring to the C:\DB_Drivers folder shown as an example on the page: http://in.mathworks.com/help/database/ug/microsoft-sql-server-jdbc-windows.html?
I believe that folder is created as a part of the driver deployment and that it can be changed by the user.
I believe that folder is created as a part of the driver deployment and that it can be changed by the user.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. Will try it.
ASKER
Hi,
Thanks for the help, yuk99. I tried the instructions on the link: http://www.mathworks.com/help/database/ug/microsoft-sql-server-jdbc-windows.html#bt8kmbi-3
But at step 5, Set up the data source using Database Explorer.
I cannot find Database Explorer on my MATLAB R2011a.
Where is the Database Explorer. I really don't like the different incompatible versions!
Please somebody, how to find the Database Explorer on R2011a. Thank you!
Jennifer
Thanks for the help, yuk99. I tried the instructions on the link: http://www.mathworks.com/help/database/ug/microsoft-sql-server-jdbc-windows.html#bt8kmbi-3
But at step 5, Set up the data source using Database Explorer.
I cannot find Database Explorer on my MATLAB R2011a.
Where is the Database Explorer. I really don't like the different incompatible versions!
Please somebody, how to find the Database Explorer on R2011a. Thank you!
Jennifer
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks. But I cannot access to the links. I have a license but the end user is not me. I have to change end users which will take at least two days.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I got it after numerous tries.
Now I an including this "integratedSecurity=true" in the URL and it worked!
Now I an including this "integratedSecurity=true" in the URL and it worked!