PC Review


Reply
Thread Tools Rate Thread

ADO Field Size issue

 
 
brittonsm
Guest
Posts: n/a
 
      22nd Apr 2008
I have been using this old for a while and now I've discovered an
error. What it does is extract data from a Lotus Notes database
(*.nsf), which I have no control over, and places the selected info
into an Excel file. Problem I'm having is that its truncating the
data it's grabbing - So the question, with this code, how do I
determine the field size and ensure I "collecting" all of the
information within that field? I'm a "good novice" - So any advice
would help...

-Thanks
Steve

Public Sub ECN_Status_Script()

Dim myServerName As String
Dim myDbName As String
Dim strSQL As String
Dim End_Row As Long
Dim i As Integer
Dim strTableNames() As Variant
Dim oConn As ADODB.Connection
Dim rs As ADODB.Recordset

strTableNames = Array("ArlManEcn", "Cum1ManEcn", "Cum2ManEcn",
"DanManEcn", "ECN", "PipManEcn", "ProdPlan", "ReyManEcn", "RosManEcn",
"SalManEcn", "SPWECN")
myServerName = "ARLNotes1/USMARINE"
myDbName = "ECNWorkf.nsf"

'Connect to a Database
Set oConn = CreateObject("ADODB.Connection")
oConn.ConnectionString = "DRIVER={Lotus NotesSQL Driver
(*.nsf)};SERVER=" & myServerName & ";DATABASE=" & myDbName
oConn.Open

'Create a recordset object
Set rs = CreateObject("ADODB.RecordSet")
rs.ActiveConnection = oConn
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
rs.LockType = adLockPessimistic
'Turn off filter if on.
If Application.Sheets("ECN Status").FilterMode = True Then
Application.ActiveSheet.ShowAllData
End If
End_Row = 4
Range("A4").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
Selection.Clear

DoEvents

For i = 0 To UBound(strTableNames)
strSQL = "SELECT ACProcessName, EcnNumber, Title, ACOriginator,
ACSubmittedDate, ACCurrentApprovers, ACAssignedDate_d " _
& "FROM " & strTableNames(i) & " WHERE (((" &
strTableNames(i) & ".ACStatus)='In Process'));"
rs.Open strSQL
Worksheets("ECN Status").Range("A" & End_Row).CopyFromRecordset rs
Range("A65536").Select
Selection.End(xlUp).Select
End_Row = ActiveCell.Row
rs.Close
Next

Set rs = Nothing

End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
You can't change the data type or field size of this field error. =?Utf-8?B?TWVsYW5pZQ==?= Microsoft Access 2 3rd Aug 2007 03:08 PM
Issue with DOCPROPERTY field inside LINK field sven@frozensun.net Microsoft Word Document Management 5 17th Jan 2007 02:49 PM
Hyperlink Field Size - max field size = 255...why? =?Utf-8?B?U3RldmVT?= Microsoft Access 2 15th Mar 2005 04:23 PM
How to define an autonumber field with a field size of Replication ID? Laser Lu Microsoft Access 3 13th Dec 2003 11:47 AM
Need help on designing an autonumber field with GUID field size? Laser Lu Microsoft Access Database Table Design 1 13th Dec 2003 12:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:28 AM.