Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 24th, 2003, 04:45 PM
atul atul is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 2 atul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Run-Time error 424

I am trying to show records of a table from c:/atul/db1.mdb database in a form and I am writing the code in the OnClick event of a button but I keep on getting error.

Code used is:
-------------------------
Dim connstring
Dim connconnstring = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=c:/atul/.mdb"

Set conn = server.CreateObject("ADODB.Connection")conn.Open connstring
--------------------------

When I run the form, I get a Run-Time error '424' and it says "Object required". It highlights server.createObject line in yellow and opens the code editor.

Do I have to create a System DSN using control panel?
If yes, please tell me the procedure of creating a DSN (I have Win 2000 Pro)?
What do we mention in "Data source name"?
(I tried to create a DSN but it gives error "Configuration process failed" and "Could not write to registry")

Is there any other method to do this in which we don't have to create a DSN?

I know I can do this by form wizard but I need the database connectivity, so that I can fetch data from more than one table and manipulate it using SQL.

I'll appreciate if someone can help me as soon as possible.

Reply With Quote
  #2  
Old September 24th, 2003, 05:47 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 22 h 9 m 49 sec
Reputation Power: 181
Server.CreateObject is an asp method. The "Server" object isn't in VB afaik

Try something like

dim conn as ADODB.Connection
set conn = new ADODB.Connection

Reply With Quote
  #3  
Old September 27th, 2003, 09:17 PM
atul atul is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 2 atul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
dim conn as adodb.connection
dim rs as adodb.recordset
dim qry as string
dim i as integer

set conn=new adodb.connection
set rs=new adodb.recordset
qry="select * from employee"

conn.open "provider=msdasql.1;data source='mydsn'"

rs.open qry, conn
rs.movenext
forms!form1!add.value=rs.fields("address")

rs.close
conn.close
--------------------------
Thanks Doug, I was able to setup database connectivity using the method told by you.

I am using the above code in onClick event of a command button and getting data in a text box. For this I created a System DSN named "mydsn".
Now the problem that I am facing is that there are some systems that have WIN NT. I don't know if we can create system dsn in NT.
Is there any way to create a connection without depending on DSN? If yes, please send me a link which explains the same.

Reply With Quote
  #4  
Old November 29th, 2003, 09:22 AM
louis cabri louis cabri is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 louis cabri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
run-time error 424

I get “run-time error 424, object required”, on a Compaq laptop with ME operating system.

The computer freezes and only thing that works is to do control alt delete, but then it comes back to the same run-time error 424 and adds, “Explorer cannot quit”

I thus cannot use the computer at all.

What can I do? Is there a problem with the operating system (bought new in April 2001).

Thanks
LJC

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Run-Time error 424


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway