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!

MAS90 ODBC Through ASP

Status
Not open for further replies.

nathansym

Programmer
May 13, 2002
1
US
Hello,

I have been able to access MAS90 info with ODBC driver through VB and Microsoft Query/Excel ....

But every time I try to use ASP to access MAS90 data I get the following error ....

-----------------
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Sage Canada][PVX ODBC Driver][FILEIO]Table is not accesible
/mas90/invoice.asp, line 27
------------------

Here is my ASP code .....

-----------------
strconn = "DSN=MAS90"
strhhsql = "SELECT * FROM ARN_invhistoryheader WHERE InvoiceNumber ='" & strinvnumb & "'"
Set objhh = Server.CreateObject("ADODB.Recordset")
objhh.open strhhsql, strconn '<===// Line 27 //===
-----------------

As I said .... I use the same &quot;DSN=MAS90&quot; to access data in VB and it works ....

Does anyone know how to access MAS90 data through ASP?
 
Greetings nathansym,

I have been struggling to get this to work. Have you managed to get something to work via asp? I have observed the VBA examples, but don't have the expertise, yet, to implement an asp /VB Script solution. Would you mind posting your entire asp code relative to your post. If I could even get the same error you are getting, it will be progress on my end.

I eagerly await your resonse.

ABJ

 
Hi

Did anyone find a solution to this problem.
Would be much obliged if someone could post the fix.

Thanks
Ritesh
 
I was getting the same error when I tried to access MAS90 data from a perl script on an Apache server (running on W2K).

I was able to correct the problem by assigning a user log-on to the Apache service in the services control panel. (since this is strictly an internal thing in my case, I used my user name and password).

It seems that the script was fine all along, but the Apache service didn't have enough rights to access ODBC.

(hopefully this can help lead you in the right direction)

-keith
 
Keith

Your post gives me some hope and if worse comes to worse, I can setup Apache and try and get that going. I have tested many different methods for establishing access from my IIS webserver to my database but have failed.

Thank you for your response / testimonial of a successful connection. Did you use chili / asp or php with your apache webserver? Also, if you wouldn't mind posting your connection string, I'd love to take a look at it.

ABJ
 
ABJ,

I am using CGI with perl on my Apache server. Here is a sample script I tested this morning (this is assuming that SOTAMAS90 is a valid DSN and you fill in the correct company and user info):
Code:
#! c:\perl\bin\perl.exe
## Testing ODBC

use Win32::ODBC;

{
 local ($oldbar) = $|;
 $cfh = select (STDOUT);
 $| = 1;
 #
 # print your HTTP headers here
 #

print &quot;content-type: text/html\n\n&quot;;

 $| = $oldbar;
 select ($cfh);
} 

$DSN=&quot;DSN=SOTAMAS90;Company=***;UID=***;PWD=***&quot;;

if (!($db=new Win32::ODBC($DSN))) 
	{
	print &quot;Error connecting to $DSN\n&quot;;
	print &quot;Error: &quot; . Win32::ODBC::Error() . &quot;\n&quot;;
	}
else 
	{
	print &quot;Database is being searched...\n<br>&quot;;
	}

$SqlStatement = &quot;SELECT * FROM IM1_InventoryMasterfile&quot;;

if ($db->Sql($SqlStatement)) 
	{
	print &quot;SQL failed.\n&quot;;
	print &quot;Error: &quot; . $db->Error() . &quot;\n&quot;;
	}
else  
	{
	while($db->FetchRow()) 
		{
		%Data = $db->DataHash();
		$ItemNumber = $Data{&quot;ItemNumber&quot;};
		$ItemDescription = $Data{&quot;ItemDescription&quot;};
		print $ItemNumber.&quot;-&quot;.$ItemDescription .&quot;<br>&quot;;
		}
	}

$db->Close();

print &quot;</BODY></HTML>&quot;;
 
Kieth

Your answer led me to think a little today and I checked permissions of the IUSR on the MAS90 directory and Bingo - it did not have permissions to the directory.

Anyway - that problem was fixed only to be replaced by another as follows -
Provider error '8000ffff'
Catastrophic failure

This happens on line :
Conn.Open &quot;Driver={MAS 90 32-Bit ODBC Driver}; Directory=E:\Apps\MAS90; UID=RXB;PWD=RBMA5;Company=TMP;Buffer=32&quot;

No various reads on this points to the MDAC. Dunno what I'm going to do now.

:-(
-Ritesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top