extensibility library & printing functions to a table

the_net_2.0

Banned
Local time
Today, 14:14
Joined
Sep 6, 2010
Messages
812
all,

I've got this really strange problem with the uploading of a .txt file into our MySQL database on our server. I have a function in one of my databases that uses the extensibility library and prints out out to a table all of the subs and functions in the db's vba project. The actual code for each procedure is printed to a memo field, and this is a small part of the procedure that prints to the table:
Code:
                For j = 1 To .CountOfLines
                   If InStr(.Lines(j, 1), "Function") = 1 Then
                      fName = Mid(.Lines(j, 1), (InStr(.Lines(j, 1), " ") + 1), _
                                 ((InStr(.Lines(j, 1), "(")) - _
                                 (InStr(.Lines(j, 1), " ")) - 1))
                         fStart = True
                         strCode = ""
                            rs.AddNew
                               GoTo GetLine
                   ElseIf InStr(.Lines(j, 1), "//LL") > 0 Then
                         fStart = False
                            strCode = strCode & vbCrLf & .Lines(j, 1)
                               rs!fName = fName
                               rs!fcode = strCode
                               rs.Update
                            strCode = ""
                   Else

GetLine:
                      If fStart = True Then
                         strCode = IIf(strCode = "", .Lines(j, 1), _
                                       strCode & vbCrLf & .Lines(j, 1))
                      End If
                   End If
                Next j

I am printing a linefeed out between the code lines so the functions print exactly the way they look in the vba project. I export this printed table out to a .txt and then upload that .txt through phpMyAdmin for our online database. The problem I have is that phpMyAdmin throws an error out at me telling me that there is an invalid column count in the file on the first record it reads.

I figured out the issue, but it does not make any sense whatsoever. For instance, I can import the following block of text as part of a 3-column file and it throws the same error:

Code:
oFile.writeLine wStrNEWLINEHERE      oFile.CloseNEWLINEHERENEWLINEHERECleanup:NEWLINEHERE

    Set fso = NothingNEWLINEHERE    Set oFile = NothingNEWLINEHERE

BUT, I can break that block up into 3 smaller ones and upload the results, and everytime it take it just fine! For that block, I substituted the 'NEWLINEHERE' for actual line breaks so I know the problem is not the breaks. Does anyone have an idea as to what this could be? The problem is obviously the length of the memo field (if it gets too long).

I know the field settings in the Admin tool are correct and that they work because my PHP script that uploads this exact same text works fine through an APPEND query in a PHP script.

thanks for any suggestions!
 
this is solved. I simply printed the php code out into the table along with the content I was already printing and pasted it into a php webpage and ran the script. kind of a strange solution, but one that works!
 

Users who are viewing this thread

Back
Top Bottom