Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to MAS 90 via ODBC in .NET

Status
Not open for further replies.

DotNetHead

Programmer
Feb 3, 2003
6
0
0
US
Connecting to the SOTAMAS90 dsn in Access or Visual Basic 6 is rather simple. But in trying to do the same thing in VB.NET I am running in to some errors. The first noticeable problem is when making a new OleDbConnection the providex MAS 90 32-Bit ODBC Driver does not even show up. The Microsoft OLE DB Provider for ODBC Driver is the only ODBC driver that shows up. I went ahead and tried the Microsoft driver, when I select the SOTAMAS90 dsn... then do a “test connection” it is successful. But when I OK out of the Data Link Properties on the DbConnection I get this error message, "The .Net Data OLE DB Provider(System.Data.OleDb) does not support the MSDASQL Provider, Microsoft OLE DB Provider for ODBC Drivers." I hope this is just me overlooking something obvious but if there are any other .Net programers out there who are connection to MAS I'd love to know how.
Thanks!
 
scohen,

Thank you so much for the rapid response. I tried adding the following line to my web.config file:

<identity impersonate="true" userName="un" password="pw"/>

... with "un" and "pw" being my login user name and password for the server. I placed this line first within the system.web tags in my web.config, then, when that didn't work, between the appSettings tags. Either way, I still get the "table not accessible" error. Frustrating beyond words!!

Any ideas what else I might try? My connection string in my ASP.NET page (VB.NET) is:

dim myConnection As OdbcConnection = New OdbcConnection("DSN=SOTAMAS90_silent; Directory=***\Best\MAS 200\Version4\MAS90; Company=ABC; LogFile=\PVXODB32.LOG; SILENT=1; SERVER=NotTheServer")

...where "***" is the correct directory path, of course. "SOTAMAS90_silent" is a System DSN that I set up per specs sent to me by Best Software. Also, FYI, here is the SQL statement I'm trying to execute:

dim TablesCMD As odbcCommand = New odbcCommand("SELECT * FROM ap_01abc", myConnection)

Not sure if any of this helps clarify my situation. Again, thank you for any ideas at all...
 
Hi RyanSpeakman,

Sorry about the delay. I haven't tried the connection to MAS90 via a DSN, but I think you are missing the UID and PWD parameters in your connection string.

FYI - DSN connections are slower compared to an ODBC connection. DSN-less connections are also easier to maintain as you don't have to worry about creating the DSN whenever the application is relocated.

My connection string: Driver="{ProvideX 32-Bit ODBC Driver};Directory=" + m_strMAS90Directory + ";UID=" + m_strMAS90UID + ";PWD=" + m_strMAS90PWD + ";Company=" + m_strMAS90CompanyCode.ToUpper

"m_" variable are my own variables. Replace these with your own values.

P.S. - You were correct the first time, the impersonation tag is placed inside the system.web tags.

Let me know if this help
 
Could these issues have to do with one machine being in a different domain?

I'm having the same problem with the "table not accessible" error. Everything works fine on my dev machine but once I move it to a machine on a different domain it no longer works.
 
I havn't heard of something like that being an issue. If it works in your dev environment, then it should work just fine in production. Anybody else heard of this being an issue. If so, it would be helpful to know about for all of us.

MAS 90 Expert
 
Hi Scohen,

I've been able to connect to the Mas90 data if the web server is on the same machine as the mas90 installation, but when the two are separate, I'm still getting the: "Table is not accessible" error. I've done the following:
1. connection string: strConn = "Driver= " + "{ProvideX 32-Bit ODBC Driver};Directory=" + m_directory + ";UID=" + m_uid + ";PWD=" + m_pwd + ";Company=" + m_company
2. Web.config file contains the line: <identity impersonate="true"/> right under the <system.web> tag
3. The ASPNET user has access to the Mas90 share

Am I missing something?

 
Hi dgprog,

Couple of things to note:
1. Make sure the company code in the connection string is in upper case letters.

2. Impersonation: The tag in the web config file also needs the username and password of who to impersonate. Try it first with your own username and password (the one you use to log into your computer) to test it out. After you that works, I suggest creating a new user with limited access rights for the actual deployment. <identity impersonate="true" userName="MyUserName" password="MyPassword"/>

Let me know if this helps.
 
Table not accessible.

Windows App using vb.net 2003.

I can access the table information using Server Explorer but I get the "Table Not Accessible" error during runtime.

My connection string is as follows:

DSN=SOTAMAS90_silent;DIRECTORY=%path%;Company=ABC;UID=XX;
PWD=xxx;ViewDELL=%path%;LogFile=%path%;CacheSize=4;
Debug=1;DirtyReads=1;BurstMode=1;SILENT=1;SERVER=NotTheServer

My MAS90 UID security level is higher than the ODBC security level for the table. I have tried numerous combinations of connection strings but I keep getting the same error.

Any help would be greatly appreciated.
 
I'm not quite sure what type of connection you are using. If you are using a DSN, then why are you also specifying the server name?

Try using an ODBC connection with the connection string I posted back on April 12.

Let me know of your progress.

 
scohen,

Thanks for the reply.

I fixed the problem. It turned out to be a simple type-o in the SQL Select statement.

Thanks,
Reid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top