I am not sure which string has your query result but from the code posted by wayne it looks like its Conn. So you could try
invoke SetWindowText , hEdit01, addr Conn.
Hope that helps :grin:
Posted on 2003-11-19 22:20:28 by Odyssey
hi Odyssey,

Thanks for your suggestion but Conn is my
select * from AngBiblia where book = ? and verse = ?.
;) This is the filldata proc of mr Iczelion ;

FillData proc
LOCAL lvi:LV_ITEM
LOCAL row:DWORD

invoke SQLBindCol, hStmt,1,SQL_C_CHAR, addr TheName, sizeof TheName,addr NameLength
invoke SQLBindCol, hStmt,2,SQL_C_CHAR, addr TheSurname, sizeof TheSurname,addr SurnameLength
invoke SQLBindCol, hStmt,3,SQL_C_CHAR, addr TelNo, sizeof TelNo,addr TelNoLength
mov row,0
.while TRUE
mov byte ptr ds:,0
mov byte ptr ds:,0
mov byte ptr ds:,0
invoke SQLFetch, hStmt
.if ax==SQL_SUCCESS || ax==SQL_SUCCESS_WITH_INFO
mov lvi.imask,LVIF_TEXT+LVIF_PARAM
push row
pop lvi.iItem
mov lvi.iSubItem,0
mov lvi.pszText, offset TheName
push row
pop lvi.lParam
invoke SendMessage,hList, LVM_INSERTITEM,0, addr lvi
mov lvi.imask,LVIF_TEXT
inc lvi.iSubItem
mov lvi.pszText,offset TheSurname
invoke SendMessage,hList,LVM_SETITEM, 0,addr lvi
inc lvi.iSubItem
mov lvi.pszText,offset TelNo
invoke SendMessage,hList,LVM_SETITEM, 0,addr lvi
inc row
.else
.break
.endif
.endw
ret
FillData endp


thanks in advanced.

regards,
coredump
Posted on 2003-11-20 00:12:33 by coredump
Please help me :confused:
i need your help...

FillData proc
invoke SQLFetch, hStmt
invoke SetWindowText,hEdit01,NULL
invoke SetWindowText ,hEdit01,addr ???
; can you tell me where is my query result?
ret
FillData endp


regards,
coredump
Posted on 2003-11-20 03:03:45 by coredump
Bind with SQLBindCol a buffer (After binding call SQLFetch) and use it for SetWindowText
Posted on 2003-11-20 04:46:13 by roticv
Hi roticv,

Thank you! I GOT IT!!!

Thank you to all of your help!
GOD Bless to all!



regards,
coredump
Posted on 2003-11-20 20:34:13 by coredump
I change the FillData to
Posted on 2003-11-20 20:41:08 by coredump
hello Guy!

Follow-up question! in order to disable and enable the Menu Command we use:

invoke EnableMenuItem,hMenu,IDM_CONNECT,MF_GRAYED
invoke EnableMenuItem,hMenu,IDM_DISCONNECT,MF_ENABLED

my question is what if i want to disable a button? what is the equivalent of this
command ?



thank you in advanced


regards,
coredump
Posted on 2003-11-20 22:01:08 by coredump
Use "invoke EnableWindow, ButtonHandle, FALSE".
Posted on 2003-11-20 22:19:58 by bitRAKE
hi bitRAKE,

Thank you! I got it.

The search to the database is now running.
But how can i view the Previous and Next recordset in the database?
Example if I click the button Previous then the recordset move back 1
and if I click Next button the recordset move forward 1.?


Thanks in advanced,


regards,
coredump
Posted on 2003-11-20 23:28:04 by coredump
SQLFetchScroll

Of course you would need to return a recordset that would
include all the records you wanted to scroll thru.
Posted on 2003-11-21 15:38:28 by Wayne
hi Wayne,

what is the syntax of SQLFetchScroll?
can you give some example?


Thanks in advanced,


regards,
coredump
Posted on 2003-11-21 18:39:39 by coredump
i got the syntax.

SQLRETURN SQLFetchScroll(
SQLHSTMT StatementHandle,
SQLSMALLINT FetchOrientation,
SQLINTEGER FetchOffset);
Posted on 2003-11-21 22:56:44 by coredump
what do you think is the problem with this code?
it's not working.

Posted on 2003-11-22 00:08:07 by coredump
coredump,

if you are using the recordset of your 'select * from AngBiblia where verse = ? and books = ?' statement, then you have a recordset of only 1 record. Therefore you cannot scroll prev or next.You will need to select a recordset that contains all the records you wish to scroll thru.
Posted on 2003-11-22 12:31:19 by Wayne
hi Wayne,

so i will change my recordset to "'select * from AngBiblia" then if i click the
Read button it will add "where verse = ? and books = ?" ?
Posted on 2003-11-23 19:00:47 by coredump
hello Wayne,

Can you give me example on how to do that?


regards,
coredump
Posted on 2003-11-23 19:15:28 by coredump
question...

I have a problem with the statement Posted on 2003-11-23 21:44:45 by coredump
I have not read all thre pages, but could this be what you are looking for?
.data

szSelect db "select * from AngBiblia WHERE text like '*",0
szTheRest db "*'",0

.data?
par dd 16 dup (?)
SQL dd 256 dup (?)

.code
invoke RtlZeroMemory,addr par,16
invoke RtlZeroMemory,addr SQL,256
invoke lstrcpy,addr SQL,addr szSelect
invoke GetDlgItemText,hDlg,hEdit03,addr par,16
invoke lstrcat,addr SQL,addr par
invoke lstrcat,addr SQL,addr szTheRest


Regards
Posted on 2003-11-24 05:25:00 by minor28
Hi coredump,

probably the easiest way to do what I think you are trying to accomplish is to add a new number field
to your database and assign a sequencial number to each record. You can do your 'select' statements like
you are doing now. For 'Next/Prev' buttons you would read the 'number' field of the current record
and do a select like "select * from AngBiblia where number = " for "Next" or
"select * from AngBiblia where number = " for "Prev".
That's a quick & dirty way to accomplish scrolling without getting into ODBC cursors & bookmarks.

Also, sorry about not answering your PM. I did'nt see it until yesterday.

Are you planning on using multiple words in your search ?
Posted on 2003-11-24 11:57:08 by Wayne
hi Wayne,

Good Morning! I try to run your attachment but i encounter an error
"Record not found".Thank you so much. for your time...
Yes i'm planning on using multiple words in my search.

Thanks in advanced.



hi minor28,

thank you! i will try your suggestion after i finish the Previous & Next button .


regards,
coredump
Posted on 2003-11-24 19:23:50 by coredump