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 January 20th, 2004, 11:37 AM
rochesternew rochesternew is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 20 rochesternew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question URGENT: Problem in using DAO Recordset

Hi all,

Actually i want to copy the value returned by a SQL query into a text box. I'm using the following code.

Dim sqlTxt As String
Dim sSocial As String
Dim db As DAO.Database
Dim rs As DAO.Recordset

Set db = CurrentDb()
sSocial = SSN.Value

sqlTxt = "Select Student.[GRADUATION DATE] from Student where Student.SSN = '" & Me.SSN & "';"


Set rs = CurrentDb.OpenRecordset(sqlTxt)

Me.expectedGradDate = rs("GRADUATION DATE")



I am getting data type mismatch in criteria expression Run Time error 3464.

I have included DAO 3.6 library. Please help me out.

Thanks in advance.

--Roche

Reply With Quote
  #2  
Old January 21st, 2004, 10:43 AM
supersubra's Avatar
supersubra supersubra is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Coimbatore, India
Posts: 280 supersubra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 15 m 10 sec
Reputation Power: 6
Just for getting one value in textbox you can use the following line

me!expectedGradDate = dlookup("Graduation Date","Student","SSN = '"& Me.SSN & "')

If SSN data type is number use the following line

me!expectedGradDate = dlookup("Graduation Date","Student","SSN = "& Me.SSN)

Reply With Quote
  #3  
Old January 22nd, 2004, 01:09 PM
rochesternew rochesternew is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 20 rochesternew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks

Hi supersubra,

Nice to hear that u r from coimbatore. I am from Warangal, AP. Thanks a lot man. Before trying as wot u have told me, my BOSS has checked the application and asked abt Referential Integrity(RI). But i have got a new problem. basically i have not given a thought for Referential Integrity while designing tables. Now my BOSS has asked me to enforce it. As i have heard that MS ACCESS doesn't enforce RI, i have to enforce it in the code. Am i correct??. Any suggestions!!!


Regards.
Rochesternew

Reply With Quote
  #4  
Old January 22nd, 2004, 02:28 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
MS Access does a very good jpb of enforcing Referential Integrity and would recommend using Access Referential Integrity as it will always be in place and you won't have to remember to code for it. And like most DBs it also lets you control cascade updates and deletes.

This is all built into the relationships you will establish between tables.

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > URGENT: Problem in using DAO Recordset


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 6 hosted by Hostway