|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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 |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Run-Time error 424 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|