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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB and Mas90 ODBC Connection.... 3

Status
Not open for further replies.

swhitlow

Programmer
Mar 5, 1999
3
US
I was trying to access a Mas90 system using ODBC. I've been successful in connecting but I have one problem. The login screen keeps popping up whenever you connect. I was wondering if there is anyway at all around this. Here is my current connect string:

objConn.Open "DSN=SOTAMAS90;Directory=\\fileserver\acctapp$mas90;SERVER=fileserver"

I've also tried this connect string:

objConn.Open "DSN=SOTAMAS90;Directory=\\fileserver\acctapp$mas90;SERVER=fileserver;UID=username;PWD=password;CompanyCod
e=companycode"

But I haven't had any luck. I need to pass the username, password and company code and not have the login screen to come up. Any suggestions? Thanks!
 
switlow,

Did you ever find the answer to your question regarding the ODBC error you recv'd on the MAS90. I am having this same issue and would like to know if you have found the answer. Let me know.

thanks
 
AH! I was having the same trouble as the previous three posters, but I think I have found a solution.

If you open the ODBC connection that points to MAS90, it allows you to specify a default company, userID and password.

So what I am doing is setting up a "generic" user in MAS90 that is essentially only used to access information. This way I can set the defaults in the ODBC connection and get rid of that nasty login popup.

Hope that helps.
 
I assume you're using ADO?
If so, try setting the connection object's prompt property like so:

oCon.properties("Prompt") = adPromptNever

before opening it.

If the DB requires a userid and password, you'll need to specify them either in the DSN or the connection string, or the connect will fail.

Regards,
Aaron Gunstone
 
Here's the vb code to connect. It took me a while, but it was syntax that was getting me.

Dim MyConnection As ADODB.Connection
Set MyConnection = New ADODB.Connection
MyConnection.ConnectionString = "DSN=SOTAMAS90;User=ZZZ;Password=ZZZZZZ;Company=ZZZ"
'MyConnection.Properties("Prompt") = adPromptNever
MyConnection.Open

I commented out the properties option and it still worked without prompting. I was able to open it up and run queries. Now that I showed you this, maybe you can help me. I can run a simple SQL query, but trying to use the 'WHERE' to find specific dates is giving me problems.

My command is "select * from API_InvoiceHistory where CheckDate = #12/20/2001#". However, it doesn't like it. No matter how I try it ('12/20/2001', etc), it still doesn't work. I did to a "Where CheckDate is not null" and that worked, but how do I specify a specific date? Thanks for your help.

Mark Pemberton
mpemberton@iliant.com
 
Hmmm,

I am lost We have been playing around with this for about 3 weeks with no luck. We tried your code mpemberton but it still prompts us.

Is there any settings in Mas90 that must be changed???
I don't know if this helps but the ODBC drive has a spot to put a company, username, and password. That doesn't work. The info I put in gets wiped out every time I run Mas90

Help!!!!
 
The solution really depends upon the version of MAS90 you are on. If your version is 3.30 or greater than you need to create a new MAS90 ODBC driver otherwise you have to edit the registery (I am going to assume you are on 3.30 or greater)

Steps to follow:
1). go into the ODBC data sources and select the 'ADD' button.
2). Select the MAS90 32 bit ODBC driver
3). For your data source name it needs to begin with SOTAMAS90 (I usually set it up with the company code. For example if my company code is ABC I would set it up as SOTAMAS90_ABC)
4). Input the path, Company code (in capital letters), User Code (if the user code is only 2 characters or less you need to add additional spaces to make it 3 characters long), and password.

Now use this data source in VB the ODBC driver will not prompt for a user name or password.

The reason it does not work for the SOTAMAS90 driver is because every time you go into MAS90 it rewrites the path and blanks out the company code and user name to prevent problems in MAS90.

I hope this helpful and clear.

 
disaacson thanks for the post we got it.
It was really stupid. Our login idea was 'Q' we needed two more spaces. :)

Thanks again for the help!!!!
 
Hi all,

I'm new to tek-tips, but it seems pretty useful and cool.
I am trying to create a DSN connection to MAS90 using VB.NET.

What is the provider name for the MAS 90 driver?
 
FYI...

In order to make the Mas90/ProvideX ODBC driver work with the .NET framework, I had to use the Microsoft.Data.ODBC class that you must download and install from Microsoft.

It works fine now for reading. We will be purchasing the ProvideX ODBC Read/Write driver to write back those horrible record strings to MAS 90.
 
I'm struggling to eliminate the login prompt when accessing MAS90 ODBC also. I followed the instrctions above and didn't work for me. I used MAX90 3.3 and ProvideX 2.1. Any other suggestions for my issue.

Thanks.
 
Hi all...
I am new to tek-tips, but I was wondering if any of you might be able to provide some input to my situation. All I need to do is get data out of MAS90 and compare it to an an existing Excel spreadsheet (meanwhile dumping both data sets into a report to create charts, etc.).
My question is:
What would be the easiest or most flexible way to do this? Right now I am thinking of making a small Access database to interface between the two data sources; however, I'm wondering if Crystal Reports might be a better way since it is "supported" in MAS90. Or is there a better solution that I am not seeing?

Thanks.
 
I put the following code in a ASP pages to make the connection to MAS90 Database. However, it always gives me a error message saying
"Error Type:
Microsoft VBScript compilation (0x800A0408)
Invalid character
/mas/Default.asp, line 30, column 58"
Anyone knows how to fix it. Thanks!

Dim conn
Set conn = Server.CreateObject(ADODB.Connection)
conn.Open "DSN=SOTAMAS90;UID=xxx;PWD=xxxx;CompanyCode=xxx"  
 
I am trying to access MAS90 files from .NET. Since I am not on the machine running MAS90, I am not sure which files I need. I have installed ProvideX and am using the .NET ODBC connection object. I seems like the driver is working, but I keep getting the "Table is not accessible" message. I've tried dozens of variations.
 
ODBC connect string uses "Company=", not "CompanyCode="

 
How to get rid of the login box when using ODBC to access MAS90 in vb.net?

Thank you.
 
Here is how to connect using VB.Net 2005 Express; note that the connection string comes from MAS90's SOTAMAS90 DSN, directly from ODBCAD32. The MAS90 Signon will *not* popup if
company, uid and pwd are valid

-------------------------------------------------------
NOTE: You need Microsoft's OLE DB Provider for ODBC
-------------------------------------------------------

Imports System.Data
Imports Microsoft.Data.Odbc

' Database Connection
Public dbConn As OdbcConnection = Nothing
Public dbCmnd As OdbcCommand
Public dbReader As OdbcDataReader
Public dbConnStr As String
Public dbError As Exception

' Connect to MAS90 using ODBC; dbError stores the
' exception if any
Sub connectToDatabase(ByVal company As String, ByVal uid As String, ByVal pwd As String)

Dim dsn As String = "SOTAMAS90"
Dim timeout As String = "360"

' Build the connection string
dbConnStr = "DSN=" + dsn + _
";Directory=M:\MAS90" + _
";Prefix=M:\MAS90\soa\" + _
";ViewDLL=M:\MAS90\Home\" + _
";SERVER=NotTheServer" + _
";Company=" + company + _
";UID=" + uid + ";PWD=" + pwd + ";"

' Connect if not already
If (dbConn Is Nothing) Then
Try
dbConn = New OdbcConnection(dbConnStr)
dbConn.ConnectionTimeout = timeout
dbConn.Open()
dbError = Nothing
Catch ex As Exception
dbError = ex
dbConn = Nothing
End Try
End If

End Sub
 

I have been fighting this problem all day and really did come up with a solution. I'm making an ASP that looks up parts from MAS90 using ODBC. I kept getting a 'table inaccessible / file i/o' error. I tinkered with the connection string for a long time, and eventually got this string to work. Note the full UNC name of the server, and the UID being name|companycode. The MAS90 DSN is an exact replica of the SOTAMAS90 User-DSN that is created during installation.

Connection string follows.

"DSN=MAS90;UID=user|001;PWD=;Directory=\\servername\Version4\MAS90\;SERVER=NotTheServer"

Here is a simple ASP script that will list all the field names in the Inventory master table it should help anybody get started making ASPs for MAS90:

<%

varTable = "IM1_InventoryMasterfile"
varConnectStr = "DSN=MAS90;UID=USER|001;PWD=;Directory=\\servername\Version4\MAS90\;SERVER=NotTheServer"

response.write "<p>" & varConnectStr & "</p>"

dim oConnS
set oConnS=server.createobject("ADODB.connection")
oConnS.open varConnectStr

dim rsUser
set rsUser=server.createobject("ADODB.recordset")
sqltext = "SELECT * from " & varTable & " "
' sqltext = "SELECT * from [" & varTable & "];"

response.write "<p>" & sqltext & "</p>"
rsUser.open sqltext, oConnS


For Each Field in rsUser.Fields
response.write Field.name & "<br>"
next
rsUser.close
set rsUser=nothing
%>

I hope this helps someone as much as it did me.
Cheers!
 
I am using Mas90 4.05. I created a DSN with the Company and User ID. I am using the switchboard to open a form and I always get the Mas90 login box. I have linked all the tables using the correct DSN. Where can I turn the Login box off? It does go to the correct company data, but I would like to eliminate the Pop-up box.

I do not know much about access. Mostly wizards.

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top