Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: ASP and AS400 conneciton


Message #1 by "Lee Hopkins" <ljhopkins_1@y...> on Wed, 21 Aug 2002 16:51:07
I am unable to get my connection to work I keep geting the same error
Microsoft OLE DB Provider for ODBC Drivers error '80004005' 

[Microsoft][ODBC Driver Manager] Data source name not found and no default 
driver specified 

/prod_ol_rpt/kpdat11.asp, line 24 
I have tried a number of connection strings
1. 'DNS1 = "(Client Access ODBC Driver (32-
bit));Server=KPDAT11;UID=xxxx;PWD=xxxx;database=kpdat11"
2.
objConn.Open "Provider=Client Access ODBC Driver (32-
bit);Password=xxxx;Persist Security Info=True;User ID=xxxx;Initial 
Catalog=COSTELLO;DATA SOURCE=10.253.1.6
3.objConn.open "DSN = KPDAT11; UID = xxxx; PWD = xxxx"

but all return the same error
Help!!!!!!!!!!!
Message #2 by "Rob Parkhouse" <rparkhouse@o...> on Thu, 22 Aug 2002 01:01:29
> I am unable to get my connection to work I keep geting the same error
M> icrosoft OLE DB Provider for ODBC Drivers error '80004005' 

> [Microsoft][ODBC Driver Manager] Data source name not found and no 
default 
d> river specified 

> /prod_ol_rpt/kpdat11.asp, line 24 
I>  have tried a number of connection strings
1> . 'DNS1 = "(Client Access ODBC Driver (32-
b> it));Server=KPDAT11;UID=xxxx;PWD=xxxx;database=kpdat11"
2> .
o> bjConn.Open "Provider=Client Access ODBC Driver (32-
b> it);Password=xxxx;Persist Security Info=True;User ID=xxxx;Initial 
C> atalog=COSTELLO;DATA SOURCE=10.253.1.6
3> .objConn.open "DSN = KPDAT11; UID = xxxx; PWD = xxxx"

> but all return the same error
H> elp!!!!!!!!!!!


This is an Access forum. Some sample code to connect to an Access database 
is as follows. Don't know what you need to do for AS400.

  Dim strConnect, objConn, objRS

  strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=rob;" & _
	       "Data Source=C:\mydata.mdb;" & _
	       "Persist Security Info=False;Jet OLEDB:System " & _
               "database=c:\myadmin.mdw"

  ' Create Connection and Recordset objects
  Set objConn = Server.CreateObject("ADODB.Connection")
  Set objRS = Server.CreateObject("ADODB.Recordset")
	
  ' Connect to the database
  objConn.Open strConnect

  ' Open a recordset
  objRS.Open "SELECT ClientID, Name FROM Customer " & _			
	     "WHERE ClientID = '" & varClientid & "' ORDER BY Name;" _
	     ,objConn, adOpenForwardOnly, adLockReadOnly, adCmdText




Good luck


  Return to Index