|
If you execute that directly against the database without your application, does it fail?
|
|
|
|
|
It fails when running it against a RBDMS. The booleans don't cause any havoc. It inserts to9 the Description field and then no more
Stephen Lintott Bsc IT (RAU)
|
|
|
|
|
Since I don't know the structure of your table, I'm not able to sy if all the values are in correct places. However, you could check if the pairs match (if not done so already)
Here's the colum/value list in different format. The Descriptn value look quite large, perhaps it's over the max length?
Uniqueid 5
trantype 49
ledgerno 2
accountid 'CNBPZF@CQU'
userno 1
entrydate CTOD('1/26/2009')
entrytime 58694.616
lineno 0
trandate CTOD('12/31/2008')
periodno 78
batchno 356550
internref 'PO-JAC01360 '
externref 'PO-JAC '
hedgecode 'N'
logged 'F'
descriptn 'Purchase Order
'
payee ' '
presented 0
held 'F'
previous 'F'
ositem 'F'
ledger2 2
account2 'CNBPZF@CQU'
taxtype1 ' '
taxcode1 0
taxamount1 0
taxtype2 ' '
taxcode2 0
taxamount2 -69.96
taxtype3 ' '
taxcode3 0
taxamount3 0
salescode 0
costcode ' 0'
stage ' 0'
branch 1
delivery CTOD('12/31/2008')
quantity1 0
quantity2 0
quantity3 0
amount1 -699.56
amount2 0
amount3 -699.56
amount4 0
amount5 0
cncycode 0
exchange 1
netvarnce 0
netgain 0
netloss 0
taxrebate 0
duedate CTOD('12/30/1899 12:00:00 AM')
rateid 'F '
staffid 'F '
complqty 0
ppsrate 0
purchtype 0
isjobquote 'F'
rpsgross 0
recordno 0
temppres 0
changed 'T'
discperc 0
taxperiod 0
zcostproc ' '
zpostatus ' '
|
|
|
|
|
I notice multiple booleans that appear as single character strings ('T' or 'F' ). Are those
fields actually character type or boolean type? In VFP .T. and .F. are used to indicate
booleans. If you are using parameters for the ODBC command and assign a boolean value to them it should handle them for
you, but if you are specifying their values in the command text then you may need to use the VFP boolean syntax.
Hope in one hand and poop in the other; see which fills up first. Hope and change were good slogans, now show us more than words.
|
|
|
|
|
Hi all,
I am new to vb and I am trying to get the file type of every file found during findfile here is my code:
iSearchHandle = FindFirstFile(SrcDir, pFindFileBuff)
If iSearchHandle <> INVALID_HANDLE_VALUE Then
strFile = TrimNull(pFindFileBuff.cFileName)
Do While strFile <> ""
Do While FindNextFile(iSearchHandle, pFindFileBuff)
strFile = TrimNull(pFindFileBuff.cFileName)
If strFile <> "." And strFile <> ".." Then
strFile = strDir + "\" + strFile
'strLen = Len(strFile)
fileType = Right$(strFile, 4)
I tried using Right$ to get the file type for example "TonyRobertson.ppsx", ,"version2.5.0.doc", "IMIT031211_TonyRobertson.ppt" and "MARBLES.G4"
by using that I get ppsx, .doc, .ppt and S.G4, is there another way to get the right format?
Thanks,
Jj
|
|
|
|
|
Hope you are using VB6.
There are two options to get the file type e.g.
1. Split the filename using (.) dot character and get last element in array.
2. Use FileSystemObject, that provides a lot more options on file information. For more information : Click[^]
PS: If you are using VB.NET then there are lot of utility classes in System.IO Namespace[^]
|
|
|
|
|
Hi,
I'm trying to create linear graph using C# in windows application
please help me to solve this problem.
|
|
|
|
|
karthick sampangi wrote: I'm trying to create linear graph using C# in windows application
Your question is vague. What you have tried so far and where you are facing problem? You can draw it using the classes in System.Drawing[^] namespace.
|
|
|
|
|
Please try to search in code project article base. CP itself have nice project for drawing line graphs Click here to get one[^]
|
|
|
|
|
You can use third party tools available. If you do not want to do that, you can create excel chart or do as Navneeth suggested.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
Hi,
I'm using cr 8.5 and vb6. I'm using crystal report control component in my appln. I've created report with two parameters. My report is working well alone by refreshing and passing parameters. But I'm facing problem in vb6, while I call report with passing parameters. I'm getting Invalid parameter field value in "cr1.Action = 1" line. This is my code below.
cr1.ReportFileName = App.Path & "\rptCovLetToCommodityPmnts.rpt"
cr1.ParameterFields(1) = "pBankCode:" & lstrBankCode & ":True"
cr1.ParameterFields(2) = "pDate:" & Format(cmbPaymentDate, "dd/MM/yyyy") & ":True"
cr1.Action = 1
Pls. anybody give me the soln. I tried in different ways. Tnx in adv.
Balasubramanian K.
|
|
|
|
|
Its been a while since I've used CR8.5 and VB6. Just eyeballing the code, I think it should be something like the following
cr1.LogonInfo(0) = strLogin 'This will depend on how your report is setup.
cr1.ReportFileName = App.Path & "\rptCovLetToCommodityPmnts.rpt"
'I **think** the params are zero based and pass the param value only.
cr1.ParameterFields(0) = lstrBankCode
cr1.ParameterFields(1) = cmbPaymentDate
cr1.Destination = crptToWindow
cr1.Action = 1
If you are using MS SQL for the report, you can open profiler to see exactly what Crystal is using as the query to see what is wrong as well.
Hope this points you in the right direction.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
"There's no such thing as a stupid question, only stupid people." - Mr. Garrison
|
|
|
|
|
hi i am using a stream reader to read a text file from the resource file, i have tried two way to read each line and put it into i combobox but i get the following errors, can someone point out where i am going wrong, thanks in advance
Using readfile As StreamReader = File.OpenText(My.Resources.mages)'Illegal characters in path.
Do
line = readfile.ReadLine
My.Forms.Main.cbspells.Items.Add(line)
Loop Until line Is Nothing
readfile.Close()
End Using
Using readfile As StreamReader = New StreamReader(My.Resources.magea)'Empty path name is not legal.
Do
line = readfile.ReadLine
My.Forms.Main.cbabilities.Items.Add(line)
Loop Until line Is Nothing
readfile.Close()
End Using
J.Hardy
|
|
|
|
|
Can you please try something like this :
Dim line As String
For Each line In My.Resources.mages.Split(System.Environment.NewLine)
If line <> String.Empty Then
My.Forms.Main.cbspells.Items.Add(line)
End If
Next
For Each line In My.Resources.magea.Split(System.Environment.NewLine)
If line <> String.Empty Then
My.Forms.Main.cbabilities.Items.Add(line)
End If
Next
Since My.Resource.<<resource-name>> will return content of resource, and it is not suitable to reading with StreamReader.
Please reply if this works for you
|
|
|
|
|
that works fine thank you
J.Hardy
|
|
|
|
|
Hi,
If I have more thank one Workbook open and running in the background, how do I specify which wookbook my "" line is to look up?
(See the "PROBLEM IS HERE" & "AND HERE" lines below to see where I require help with code. Something must be insertable I figure.)
The other option might be in the module where the declairations are. Maybe it's possible to link the "xlsCellTs" to "xlsSheetTs" and or "xlsBookTs".
Try
xlsBookTs = xlsApp.Workbooks.Open("F:\filelocation\ts" & Format_(Me.MonthCalendar1.SelectionStart, "yyyyMMdd") & ".xls")
ExcelTsOpen = True
'Counts slots used and assigns value to tbxTinsToday
SlotsUsedToday = 0
TotalSlots = 0
NRow = 2
'Learns how many Total Slots are avail on any day.
PROBLEM IS HERE (Below)!!
Do Until xlsCellTs.Range("A" & NRow).Value = ""
TotalSlots = TotalSlots + 1
tbxTotalSlots.Text = TotalSlots.ToString
AND HERE (Below)!!
If xlsCellTs1.Range("F" & NRow).Value = 1 Then
SlotsUsedToday = SlotsUsedToday + 1
End If
NRow = NRow + 1
Loop
tbxSlotsToday.Text = SlotsUsedToday.ToString
Catch ex As Exception 'Blank Date not previously used open SlotStatsIST.xls
xlsBookTs = xlsApp.Workbooks.Open("F:\filelocation\SlotStatsDefault.xls")
ExcelTsOpen = True
xlsSheetTs = xlsBookTs.Worksheets(1)
xlsBookTs.SaveAs("F:\filelocation\ts" & Format(Me.MonthCalendar1.SelectionStart, "yyyyMMdd") & ".xls")
ExcelTsSaved = True
End Try
Many thanks in advance to all helpers.
|
|
|
|
|
It looks like you already specified which workbook to use when you started using the Range object of the xlsBookTs object you created. Or are you asking how to specify which worksheet to use?
In that case, you can either use the corresponding Worksheet object in the Workbook's Worksheets collection, or you can directly specify which worksheet to use in the Range address specifier (.Range("A" & NRow) in your code). This would look something like .Range("SheetName!A" & NRow) .
|
|
|
|
|
I think we are getting close thanks to your help Dave.
I failed to mention the other workbooks that would be open due to trying to keep the code example to a minimum, however I am including a sample of the Module code below to show what other delairationa may be floating around in use at any given time.
Public xlsBookFds As Excel.Workbook
Public xlsSheetFds As Excel.Worksheet
Public xlsCellFds As Excel.Range
Public xlsBookTs As Excel.Workbook
Public xlsSheetTs As Excel.Worksheet
Public xlsCellTs As Excel.Range
Public xlsCellTs1 As Excel.Range
Public xlsBookMdrs As Excel.Workbook
Public xlsSheetMdrs As Excel.Worksheet
Public xlsCellMdrs As Excel.Range
In the format you mentioned;
.Range("SheetName!A" & NRow).
is the
! the code so the computer can seperate the sheet name from the cell location? That being the case I might hazard a guess that the code
.Range("BookName!SheetName!A" & NRow).
might be right.
Can thank you enough for your help so far Dave, looking forward to your reply.
Regards,
Frank
|
|
|
|
|
*Can't thank you enough* I meant. Oops
|
|
|
|
|
frankiebaby2 wrote: is the !the code so the computer can seperate the sheet name from the cell location?
That's how Excel seperates worksheet names from cell names, yes.
|
|
|
|
|
I need help figuring out how to display the sql view of a query using VBA. I have an Access 2003 database that contains a little over 300 queries. Yikes!
I know in Access you can open a query in Design view and then change the view to SQL view so that you can actually see the Select statement. Instead of doing that more than 300 times to cut and paste the query statement, I would like to write a quick macro to display the information.
I was able to figure out how to loop through all my query objects and display the name, but I can't find a way to actually get at the sql view of the query. Below is the code I have:
Dim obj As AccessObject
Dim dbs As Object
Set dbs = Application.CurrentData
For Each obj In dbs.AllQueries
MsgBox "sql view: " & obj.FullName
Next obj
When I watch the obj data, there isn't any properties for the sql view. I thought this information would be in there. Am I misunderstanding what this object contains? It seems like I'm pretty close because I'm able to see the name of all the queries I have in my DB. What crucial piece of information am I missing?
Thanks,
FMPol
|
|
|
|
|
You may want to try looking at this[^]. If that doesn't work for you, I got more results from a carefully worded Google search, "vba access query sql text[^]". No, seriously, I had to go through about 15 search phrases to find the right combination of keywords.
|
|
|
|
|
Thanks Dave that was exactly what I needed. I think every google search I tried had 'view' in it and that must have been my big problem. I've posted the new code below:
Dim db As Database
Set db = CurrentDb
Dim curSQL As String
Dim qrynam As String
For Each qrydef In db.QueryDefs
qrynam = qrydef.Name
curSQL = qrydef.SQL
MsgBox "sql name: " & qrynam & Chr$(13) & "sql view: " & curSQL
Next
|
|
|
|
|
I am using the code below to successfully insert a new line just below every occurence of BEN*JE*ZZ*1041C0700X~ in the text file C:\myFlow_35.txt. My problem is, myString does not always = BEN*JE*ZZ*1041C0700X~; it will always start with BEN*JE*ZZ*
How do I give a value to myString to consider the other possibilities?
Private Sub btnTranslate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTranslate.Click<br />
MessageBox.Show("you are about to Translate file; make sure you have documented the original Reference Number")<br />
<br />
Dim refNum As String = Me.txtFileNum.Text<br />
Dim FileName As String = "C:\myFlow_35.txt"<br />
Dim myString As String = "BEN*JE*ZZ*1041C0700X~"<br />
Dim newString As New StringBuilder<br />
<br />
newString.Append(My.Computer.FileSystem.ReadAllText(FileName))<br />
newString.Replace(myString, myString & vbNewLine & "REF*LU*" & refNum & "~")<br />
My.Computer.FileSystem.WriteAllText(FileName, newString.ToString, False)<br />
<br />
MessageBox.Show("End of Translation ... Adios!")<br />
End Sub
Please gimme some ideas ... no pressure, but I have a 10 PM deadline today!
|
|
|
|
|
There is no wildcard character in string comparisons.
You're really confusing people when you ask questions. You said this code works as expected, but it doesn't do anything anywhere close to what you said it does.
Anyway, in a previous example that you posted, you had code in there to check if the string started with a certain substring, and in this case, that would be "BEN*JE*ZZ*". So, you'd do something like this:
If myString.StartsWith("BEN*JE*ZZ*") Then
....
|
|
|
|