OCDB CONNECTION

I HAVE THE COONECTION TO MY DATABASE SET UP TO LOOK ON LOCAL DISC C:, BUT WHEN I TRY TO PROCESS THE ASP PAGE THE ERROR MESSAGE SAYS THAT THE PATH TO ANOTHER SERVER IN NOT VALID. I DO NOT HAVE IT SET UP TO LOOK AT THAT SERVER.
CAN SOMEONE EXPLAIN THIS, IS THE COMPUTER LOST?

I AM USING DREAMWEAVER MX, AN ASSESS DATABASE, AND AN OCDB SET UP FOR DRICE C:
jkleistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SNilssonCommented:
Check your ODBC connection in ODBC manager, then test it in Excel for example(using MS Query) if it behaves as expected then the error might be in your ASP code so please post your trouble code and we can have a look at it.

And btw is it not against the rules to type in caps only :)
0
neel_07Commented:
Make sure that the ODBC Driver that you are selecting is correct. At times there are multiple ODBC drivers for access databases. For example, there may be a "Microsoft Access Treiber" and aso a "Microsoft Access Driver". Make sure you   select the Microsoft Access "Driver" ODBC connection.

Also, check whether the ODBC connection that you are making is under the System DSN tab.
0
D_M_DCommented:
Are you using Server.MapPath("C:\yourdatabase.mdb") in your connection string?

If your database resides under your the root C:\ then this is a physical path and the Server.MapPath() uses virtual paths (under inetpub/wwwroot) the virtual path is based on the directory your currently in.  Please post your code.

--------
D_M_D
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

wsteegmansCommented:
Try this procedure on your WebServer (where your ASP-pages are stored).

Create in any folder on your webserver a new file with extension UDL, for example create 'test.udl' in your temp-folder.
Once created, double click on it ... The dialogbox 'Data Link Properties' is started.

Now, with this nice tool, make your connection to your SQL-Server, Access-DB or any other DB. Once configured and TESTED with the Test-Connection button, close this window.

Last step: Open this test.udl file in any Text-editor, for example NotePad. The last line in this file, starting with 'Provider ...' is your connectionstring. So copy/paste it in your ASP-file. Because we tested it in the 'Data Link Properties', it will work!

One remark. When building a connection-string (for ex. for SQL-Server) with a user that has a password, please activate the option 'Allow saving Password'. But when using an Access database, you don't need it ...

An additional link:
Guide to Database Connection Strings:
http://www.razza.com/support/kbarticle.asp?ID=2

One remark on this page, when programming ASP (VB-Script) and using MS Access, SQL-Server, I would always use the OLEDB-way to connect, because there are some disadvantages with ODBC.
0
cheekycjCommented:
Can you paste your code here

CJ
0
jkleistAuthor Commented:
SELECT left([data1],3), mid([data1],4,15), mid([data1],19,30), mid([data1],49,9), mid([data1],58,2), mid([data1],60,6)
FROM webdata
WHERE left([DATA1],3)  LIKE 'ACC'  AND  mid([data1],4,15) LIKE '%MMM%'
ORDER BY left([data1],3) ASC, mid([DATA1],4,15) ASC

THIS IS THE QUERY ON THE DATABASE....
ACC AND MMM ARE VAIABLES THAT DEFINE FIELDS ON
THE INPUT ASP PAGE.
0
wsteegmansCommented:
jkleist,

This is your SQL-Statement ... We need your Connection-String, something like
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Folder1\dbname.mdb;Persist Security Info=False
0
D_M_DCommented:
Please post all of your code the whole page...

Thanks

--------
D_M_D
0
jkleistAuthor Commented:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/net.asp" -->
<!--#include file="Connections/stockcheck.asp" -->
<%
var stock_check__ACC = "%";
if (String(Request.Form("manufacturer")) != "undefined" && 
    String(Request.Form("manufacturer")) != "") {
  stock_check__ACC = String(Request.Form("manufacturer"));
}
%>
<%
var stock_check__MMM = "%";
if (String(Request.Form("itemnumber")) != "undefined" && 
    String(Request.Form("itemnumber")) != "") {
  stock_check__MMM = String(Request.Form("itemnumber"));
}
%>
<%
var stock_check = Server.CreateObject("ADODB.Recordset");
stock_check.ActiveConnection = MM_net_STRING;
stock_check.Source = "SELECT left([data1],3), mid([data1],4,15), mid([data1],19,30), mid([data1],49,9), mid([data1],58,2), mid([data1],60,6)  FROM webdata  WHERE left([DATA1],3)  LIKE '"+ stock_check__ACC.replace(/'/g, "''") + "'  AND  mid([data1],4,15) LIKE '%"+ stock_check__MMM.replace(/'/g, "''") + "%'  ORDER BY left([data1],3) ASC, mid([DATA1],4,15) ASC";
stock_check.CursorType = 0;
stock_check.CursorLocation = 2;
stock_check.LockType = 1;
stock_check.Open();
var stock_check_numRows = 0;
%>
<%
var Repeat1__numRows = 10;
var Repeat1__index = 0;
stock_check_numRows += Repeat1__numRows;
%>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>                                                            
function DoCurrency(str, nDigitsAfterDecimal, nLeadingDigit, nUseParensForNeg, nGroupDigits)                        
      DoCurrency = FormatCurrency(str, nDigitsAfterDecimal, nLeadingDigit, nUseParensForNeg, nGroupDigits)            
End Function                                                                                    
</SCRIPT>
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>                              
function DoTrim(str, side)                                          
      dim strRet                                                
      strRet = str                                                
                                                            
      If (side = 0) Then                                    
            strRet = LTrim(str)                                    
      ElseIf (side = 1) Then                                    
            strRet = RTrim(str)                                    
      Else                                                      
            strRet = Trim(str)                                    
      End If                                                      
                                                            
      DoTrim = strRet                                                
End Function                                                      
</SCRIPT>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p><font size="+1" face="Arial, Helvetica, sans-serif"></font></p>
<p align="center">&nbsp;</p>
<p align="center"><strong><font size="+2" face="Arial, Helvetica, sans-serif">
  </font></strong></p>
<p align="center">&nbsp;</p>
<p align="left"><font size="+2" face="Arial, Helvetica, sans-serif"><strong>Stock
  Check Results</strong></font> </p>
<div align="left">
  <table border="1">
    <tr>
      <td><div align="center"><strong><font face="Arial, Helvetica, sans-serif">Mfg.</font></strong></div></td>
      <td><div align="center"><strong><font face="Arial, Helvetica, sans-serif">Item
          #</font></strong></div></td>
      <td><div align="center"><strong><font face="Arial, Helvetica, sans-serif">Description</font></strong></div></td>
      <td><div align="center"><strong><font face="Arial, Helvetica, sans-serif">Mfg.
          Retail</font></strong></div></td>
      <td><div align="center"><strong><font face="Arial, Helvetica, sans-serif">uom</font></strong></div></td>
      <td><div align="center"><strong><font face="Arial, Helvetica, sans-serif">O/H
          Qty.</font></strong></div></td>
    </tr>
    <% while ((Repeat1__numRows-- != 0) && (!stock_check.EOF)) { %>
    <tr>
      <td><div align="center"><font size="-1" face="Arial, Helvetica, sans-serif"><%= (stock_check.Fields.Item("Expr1000").Value).toUpperCase() %></font></div></td>
      <td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif"><%= DoTrim((stock_check.Fields.Item("Expr1001").Value),1) %></font></div></td>
      <td><div align="left"><font size="-1" face="Arial, Helvetica, sans-serif"><%=(stock_check.Fields.Item("Expr1002").Value)%></font></div></td>
      <td><div align="right"><font size="-1" face="Arial, Helvetica, sans-serif"><%= DoCurrency((stock_check.Fields.Item("Expr1003").Value), -1, -2, -2, -2) %></font></div></td>
      <td><div align="center"><font size="-1" face="Arial, Helvetica, sans-serif"><%=(stock_check.Fields.Item("Expr1004").Value)%></font></div></td>
      <td><div align="center"><font size="-1" color="BLUE" face="Arial, Helvetica, sans-serif"><strong><%=(stock_check.Fields.Item("Expr1005").Value)%></strong></font></div></td>
    </tr>
    <%
  Repeat1__index++;
  stock_check.MoveNext();
}
%>
  </table>
</div>
<p>To Check Another Item </p>
<p><a href="STOCK_CHECK.asp">Click Here</a></p>
</body>
</html>
<%
stock_check.Close();
%>
0
wsteegmansCommented:
This is were you connectioinstring is set:
stock_check.ActiveConnection = MM_net_STRING;

But we need the value of this variable, so I guess we need also the code of these files:
- Connections/net.asp
- Connections/stockcheck.asp

But, check first this code for usernames and passwords ... and remove them or replace them with 'userid' and 'password'
0
jkleistAuthor Commented:
<%
// FileName="Connection_odbc_conn_dsn.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="false"
// Catalog=""
// Schema=""
var MM_stockcheck_STRING = "dsn=stockcheck;"
%>




<%
// FileName="Connection_odbc_conn_dsn.htm"
// Type="ADO"
// DesigntimeType="ADO"
// HTTP="false"
// Catalog=""
// Schema=""
var MM_net_STRING = "dsn=net;"
%>
0
cheekycjCommented:
do you have a system DSN created called net?

CJ
0
wsteegmansCommented:
When using DreamWeaver MX, when creating a ConnectionString, you have this additional option:
DreamWeaver should connect:
  - Using Driver On Testing Server
  - Using Driver On This Machine

I don't know which option is selected, but it seems that you're using DSN's to connect your database. If the above option is set to Testing Server, check this Machine/Server if there is a DSN called 'stockcheck' and 'net' and also check them ...
If the option is set to This Machine (I suppose, because you write you set it up for drive C:) check your own DSN's ...

You can find your DSN-settings (if using W2K) here:
Control Panel -> Administrative Tools -> Data Sources (ODBC)

You must setup these datasources in the System DSN Tab ... Otherwise, they won't work when using in ASP-Pages ...
0
jkleistAuthor Commented:
I do have stockcheck set up but not net. I do not have a databse called net nor do i have a connection named net
0
wsteegmansCommented:
You set your ActiveConnection to the 'net' DSN, like this in your code:
stock_check.ActiveConnection = MM_net_STRING;

I think you need the StockCheck DSN-Connection, so change this line like this:
stock_check.ActiveConnection = MM_stockcheck_STRING ;

Try it ...
0
cheekycjCommented:
do you even need net connection.

Try removing that line and see if it works.

From your code it seems like you are just doing stockcheck db stuff not anything else.

CJ
0
jkleistAuthor Commented:
YES, IT IS JUST  A SIMPLE STOCK CHECK. THE ISSUE WE HAVE IS THE .dbf FILE IS ON A LOCKED DATABASE SYSTEM. I CAN EXTRACT THE DATA INTO A dbf FILE "FLAT LAYOUT", BUT WHEN
WE PUT IT ON OUR TEST SERVER IT RUNS VERY SLOW, SEQUENTIALLY SEARCHING FILE AS A dbf CONNECTION. IF I LINK THE DATABASE TO AN ACCESS mdb FILE, THE ODBC CANNOT FIND THE FILE. IT'S LIKE WE GET ONE ISSUE FIXED THEN ANOTHER GOES HAYWIRE..... WE WANT TO HAVE THE DATA AS UP TO DATE AS POSSIBLE, I HAVE AN AUTO DUMP FROM THE LOCKED SYSTEM EVERY HOUR, THEN HAVE SCHEDULER OVERWRITE THE CURRENT .dbf FILE ON THE SERVER. PART OF IT HAS TO DO WITH I.E. PERMISSIONS I THINK....I DON'T KNOW, THIS SHOULD HAVE BEEN AN EASY PROJECT...
0
wsteegmansCommented:
Your write:
IF I LINK THE DATABASE TO AN ACCESS mdb FILE, THE ODBC CANNOT FIND THE FILE.

But, you must create/adapt your DSN to this NEW Access-Database (with a different-name). Or did you do that ... ?
0
jkleistAuthor Commented:
YES I DID RENAME IT, THE I.E. ERROR SAYS SOMETHING LIKE THIS the Microsoft jet databse engine cannot find the input table or query \webdata#dbf

they are both in the same dirctory, and access is linked to it.

????
0
cheekycjCommented:
did you create the linked access mdb on your dev server before uploading it to your test server?

One thing I found out about linked tables, MS access uses exact paths.  So if you link a file in your current directory..
lets say:
c:\inetpub\wwwroot\db\webdata.dbf

It must be in the SAME exact folder on the test server otherwise it cannot find the file.

What I usually end up doing is setting up my dev file/directory structure to be identical to my production/test server.

So if in my test server the mdb and dbf files will be
c:\inetpub\wwwroot\username\db

I will create the same exact directory on my dev server and create the mdb file there with the dbf file there.  Then upload it.

CJ
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jkleistAuthor Commented:
Thanks, I'll try it tonight. First I'll dump what I've got out there to avoid errors, and start from scratch...I'll advise tomorrow.
sounds like the correct answer.
0
cheekycjCommented:
yeah, its was a pain for me as it took me a while to figure it out as I got the basic- table not found error too :-)

Keep us posted.

CJ
0
cheekycjCommented:
Glad to help and Thnx for the "A"

CJ
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.