Advertisement

03.14.2007 at 03:40AM PDT, ID: 22448296
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

lotusscript ODBC Query

Tags: lotusscript, odbc
Hi all,

I have created an ODBC agent for my notes/domino Web Application. This agent sits behind a button which admin utilises to validate that the information entered by the user do in fact exist in backend datasource and that they are correct.

The query is all correct, but what I am having a bit of trouble with is the following:

Qry.SQL = "Select * " + _
      "FROM Customer, Customer_Invoice_Line_File WHERE Customer.Number = Customer_Details.CDNumber " +_
      "And Customer.Cus_Type ='7'" +_
      "And Customer_Details.CustDetail_Type ='7'" + _
      "And Customer.Invoiceno = '"+nvVariable+"'"  
      
      Dim res As New ODBCResultSet
      End If

      RetCode% = ResHO.FirstRow
      
      If RetCode% = False Then
            Print " no records to match your query"
      exit sub
end if

do while retcode%=true

If RetCode% = True
 
        If doc.field1 = Cstr( Res.GetValue("Date”))  
    'move to next field
 else
  errormsg = "value entered in" doc.field1 is incorrect

    If doc.field2 = Cstr( Res.GetValue("product”))  
'move to field 3
else
errormsg1 = errormsg + chr(13) + "value entered in" doc.field2 is incorrect
then  third, until n fields until we finish all the fields that I need to validate with the live OCB connection against the values entered by the user.
This is the only feasible way that can be done because data amount is too large to keep in notes ......
At the end I will have a routine which after closing the connection will send the user an email informing of results if any errors.

MY PROBLEM

I am having trouble construct the valiation loop correctly. not too sure if I am on the right path up there

Can anyone give me a hand with this. It will be much appreciated.

Thank you all in advance.
Varvoura

 






Start your free trial to view this solution
Question Stats
Zone: Software
Question Asked By: varvoura
Solution Provided By: marilyng
Participating Experts: 2
Solution Grade: A
Views: 22
Translate:
Loading Advertisement...
03.14.2007 at 05:07AM PDT, ID: 18717593

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.14.2007 at 05:24AM PDT, ID: 18717698

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.14.2007 at 07:47AM PDT, ID: 18718809

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.14.2007 at 10:20AM PDT, ID: 18720318

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.14.2007 at 04:32PM PDT, ID: 18723107

Rank: Master

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.15.2007 at 01:21AM PDT, ID: 18725477

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.15.2007 at 09:29AM PDT, ID: 18728288

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • Automotive
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Displays / Monitors
  • Handhelds / PDAs
  • Components
  • Peripherals
  • Laptops/Notebooks
  • Servers
  • Misc
  • Apple
  • Embedded Hardware
  • Networking Hardware
  • Storage
  • Desktops
  • New Users
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMware
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Virtualization
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • Web Computing
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Consulting
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMware
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Automation
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Web Services
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Web Computing
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Lounge
  • Business Travel
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
  • Automotive
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.14.2007 at 05:07AM PDT, ID: 18717593

Rank: Sage

There are wonderful ODBC examples in Designer help, (Located in the HELP folder on the server)

Index on ODBC, or look in the ODBCResultSet class:

Uselsx "*LSXODBC"
Dim con As ODBCConnection
Dim qry As ODBCQuery
Dim result As ODBCResultSet
Dim firstName As String
Dim lastName As String
Dim msg As String

Sub Initialize
  Set con = New ODBCConnection
  Set qry = New ODBCQuery
  Set result = New ODBCResultSet
  Set qry.Connection = con
  Set result.Query = qry
  con.ConnectTo("ATDB")
  qry.SQL = "SELECT * FROM STUDENTS"
  If Not result.Execute Then
    Messagebox result.GetExtendedErrorMessage,, _
    result.GetErrorMessage
    Exit Sub
  End If
  REM Display result set properties after Execute
  Call DisplayResultSetProperties
  msg = "Student names:" & Chr(10)
  Do
    result.NextRow
    firstName = result.GetValue("FIRSTNAME", firstName)
    lastName = result.GetValue("LASTNAME", lastName)
    msg = msg & Chr(10) & firstName & " " & lastName
  Loop Until result.IsEndOfData
  Messagebox msg,, "Student Names"
  REM Display result set properties after processing
  REM result set
  Call DisplayResultSetProperties
  result.Close(DB_CLOSE)
  con.Disconnect
End Sub

Sub DisplayResultSetProperties
  If result.IsResultSetAvailable Then
    If result.NumRows = DB_ROWSUNKNOWN Then
      rows$ = "Not determined yet"
    Else
      rows$ = Cstr(result.NumRows)
    End If
    Messagebox _
    "NumColumns = " & result.NumColumns & Chr(10) & _
    "NumRows = " & rows$ & Chr(10) &  _
    "IsBeginOfData = " & result.IsBeginOfData & _
    Chr(10) & "IsEndOfData = " & result.IsEndOfData & _
    Chr(10) & "CurrentRow = " & result.CurrentRow,,  _
    "Result set properties"
  Else
    Messagebox "Result set not available",,  _
    "No result set"
  End If
End Sub
 
03.14.2007 at 05:24AM PDT, ID: 18717698
Thanks Marilyng, not quite what I am looking for.
I'll take a look anyway to see if I can adapt it.

Regards,
Varvoura




 
03.14.2007 at 07:47AM PDT, ID: 18718809

Rank: Master

Come on Varvoura take MarilynG's code and remove parts of it that you don't care about like the number of columns and add the parts that you want

Her code had an Execute statement yours did not, her code has a better looping mechanism for going through the result set and it will get you closer to being successful.

ALSO
If doc.field1 = Cstr( Res.GetValue("Date”))  
doc.Field1 is a variant not a string.  Try doc.Field1(0)  

<Off Topic>    
using the (0) is OK but I have a script library that has the function below and I use this function all the time.

USAGE:
This -   If doc.field1 = Cstr( Res.GetValue("Date”))  Then
Becomes This -   If FieldGetText( doc, "Date" ) = Cstr( Res.GetValue("Date”)) Then

Function FieldGetText( doc as NotesDocument, FieldName as String ) as string
   dim vVal as variant
   if doc.hasItem( FieldName ) then
      vVal = doc.GetItemValue( FieldName )
      if isArray( vVal ) then
        FieldGetText = Cstr( vValue(0) )
      Else
        FieldGetText = Cstr( vValue )
      end if
   end if
   Exit Function
End Function
</OffTopic>
 
03.14.2007 at 10:20AM PDT, ID: 18720318

Rank: Sage

All I did was paste the example from the Designer Help.    After that see beHenderson's explanation.  Simply adapt the structure to suit your needs.   All the parts need to be there for the ODBC query to work correctly.  Also, there are many more examples, including error handling that I've found quite useful.
Accepted Solution
 
03.14.2007 at 04:32PM PDT, ID: 18723107

Rank: Master

my post is a comment and is not a proposed solution or a partial proposed solution I think you will be successful adapting Marilyn's code to sit your needs if not post the code you come up with and she should have no issue spotting the errors.  I just had to point out the problem with the variant.
Assisted Solution
 
03.15.2007 at 01:21AM PDT, ID: 18725477
I will accept Marilyn's answer
a) Because she is always very helpful
b) I may be able to fiddle a bit with it to make it work and if it doesn't it, I will then post the code in a  new question.

Thank you both, much appreciated.
Varvoura
 
03.15.2007 at 09:29AM PDT, ID: 18728288

Rank: Sage

I found it helpful to start with the examples posted in Designer, since you know they're supposed to work, and then adapt that code to fit my needs.   Make sure you have all the ODBC objects instantiated in the order that they suggest.
 
 
20080236-EE-VQP-29