473,772 Members | 3,603 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access shows Notes ODBC field as zero or blank

Hello, I have a problem where a Notes field shows up in Access (via
ODBC connection) but the value is either zero or blank in Access.
I've verified the field is not zero or blank in Notes.

Background - This is an existing ODBC connection from Access to
Notes. For all other fields, it works fine. I've added a number
field to the Notes database. It shows up in Access but never has the
correct value.

Is there something simple I'm missing?

Regards,
MVSGuy

Dec 4 '06 #1
4 2299
Additional information -
The Access linked table is pulling in all documents of a specific Notes
form. I set up new linked table with the same (negative) results.
However when I set up a Notes view to display the fields, a linked
table against the view will pull in the desired results.

Pulling in the actual document does not work where pulling in a view of
all forms does.
Can anyone explain this?

Regards,
MVSGuy

Dec 6 '06 #2
Hi MVSGuy,

Yeah, I can explain it. The issue is that NotesSQL is not a true SQL
driver / interface. The only way to actually get at data is via the
views. The other objects / tables that you see are based on the
definitions of the objects themselves, and not the data that might use
that object.

If you want to play with Notes, and Notes type objects, you may be
better off trying to play with the OLE methods and objects. It all
depends on what you want to achieve. I have played with Notes for a
while now, but still consider myself a bit of a rube with it die to the
lack of decent documentation. Most of what I have learnt is via trial
and error.

I can suggest that there is a far greater deal of control and data
accessability via the OLE methodology, but it requires a bit of VBA
coding. I have attached below a sample function to read Notes emails
(you need to make a reference to the Lotus Domino Objects in the VBA
project).
This will allow you to read an email (body of text) from a notes
database, where you supply the subject of the email, and the password
to access the database for the userid.

Cheers, and I hope this helps

The Frog
-----------------------------------------------------------------------------------------------------------------------

Function MailReader(Emai lSubject As String, password As String) As
Variant

'The lotus notes client must be installed on the machine
'make sure this is done=C:\Program Files\Notes then type "regsvr32
nlsxbe.dll"
'make sure that there is a reference to "Lotus Domino Objects" under
tools/references

If EmailSubject = "" Then
MailReader = "No Subject To Search For"
End Sub
End If

If password = "" Then
MailReader = "No password given for login"
End Sub
End If

Dim Session As New NotesSession
Dim MailDB As NotesDatabase
Dim Collection As Object
Dim Document As NotesDocument
Dim Subject As Variant
Dim DocumentCount As Long
Dim BodyText() As String
Dim BodyCount As Long

Session.Initial ize (password)

Set notesdir = Session.GetDbDi rectory("")
Set MailDB = notesdir.OpenMa ilDatabase

Set Collection = MailDB.AllDocum ents

BodyCount = 0

For i = 1 To Collection.Coun t
Set Document = Collection.GetN thDocument(i)
Subject = Document.GetIte mValue("Subject ")
If Subject(0) = EmailSubject Then
ReDim Preserve BodyText(BodyCo unt)
temp = Document.GetIte mValue("Body")
BodyText(BodyCo unt) = temp(0)
BodyCount = BodyCount + 1
'Call Document.Remove (True) 'This would delete the document
from the database
'Depending on synchronisation settings the document may still
appear to be there
'but actually the document is gone and the view simply needs a
refresh to reflect
'the change
End If
Next i

If BodyCount <0 Then
MailReader = BodyText
Else
MailReader = "No email found with that subject"
End If

Set Document = Nothing
Set Collection = Nothing
Set MailDB = Nothing
Set Session = Nothing
'It is very important to do the cleanup here or else you risk a crash

End Function

Dec 6 '06 #3
The only way to actually get at data is via the
views. The other objects / tables that you see are based on the
definitions of the objects themselves, and not the data that might use
that object.
OK, that fits well with what I'm seeing. A number field in the form
shows up as text on a view.

Thank you for your help on OLE. I love it and wish I could do all my
work in it, but at the moment my question deals with a legacy PC
application. (MAN! It does a mainframers heart good to say that!!!)

The app is [poorly] written in a series of queries chained together
into a macro. I'm told not to recode it in VB as the app is 'going
away'. It's been 'going away' for years now and I'm restricted to
doing [constant] incremental changes.

Again, thank you Frog for you explanation. It helps greatly.

Regards,
MVSGuy

P.S. "Legacy PC application." Tee hee!

Dec 6 '06 #4
Anytime, glad to be of help.

Let me know if you get stuck anywhere, and if I can help I will :)

Cheers

The Frog

Dec 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
8869
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
11
6600
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
4
12441
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
4
11287
by: WolverYanks | last post by:
SELECT Dates., Sum(1) AS FROM Dates LEFT JOIN ON Dates. = . WHERE (((.)<)) GROUP BY Dates.; I'm doing a sports database, for entertainment and to learn Access, so hopefully this is an easy fix. I have a Dates table, with each date of the year. I have another table with raw game data for each basketball game. Let's say one day there are 5 games. Let's also assume that all 5 of these games are won by the "Home Team". Because "Away...
0
9620
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.