| ODBC connection in Forms 4.5 [message #357439] |
Wed, 05 November 2008 05:55  |
kelp
Messages: 10 Registered: October 2008
|
Junior Member |
|
|
Hi,
I want to connect my Developer 2000 forms 4.5 to Sql Server 2000 database.
How can i do that ?
Waiting for quick reply.
Thanks in advance.
|
|
|
|
|
|
| Re: ODBC connection in Forms 4.5 [message #357853 is a reply to message #357439] |
Thu, 06 November 2008 23:06   |
kelp
Messages: 10 Registered: October 2008
|
Junior Member |
|
|
Hi,
Thanks for reply.
I have tried by following the links and the instruction on it.
According to that link i have to connect first oracle database and then i can create a database link. And then i can connect to Sql Server Table.
But i want to connect Sql Server directly from Developer 2000, Forms 4.5 on WinXP OS.
How can i do that ?
Please give me some guideline to solve it.
Waiting for quick reply.
Thanks.
-Kelp
|
|
|
|
| Re: ODBC connection in Forms 4.5 [message #358168 is a reply to message #357853] |
Sun, 09 November 2008 23:24   |
kelp
Messages: 10 Registered: October 2008
|
Junior Member |
|
|
Hi,
I have solved this by installing OCA.
Now, i can connect to Sql Server from Forms4.5, but data coming from Sql Server are not exactly as in Sql Server. e. g. Data of type Init or Float can not displaying in Forms.
It show like this :
Data in Sql Server- "4.5546" -> showing in Forms4.5- "-:.1:1:1:1:1"
How can i solve it ?
I am in hurry to solve it.
Please give some quick reply.
Thanks.
|
|
|
|
|
|
|
|
| Re: ODBC connection in Forms 4.5 [message #358700 is a reply to message #357439] |
Wed, 12 November 2008 03:56   |
kelp
Messages: 10 Registered: October 2008
|
Junior Member |
|
|
Hellow Sir,
Now i can connect to Sql Server through Forms4.5.
I created a View in Sql Server and data are correctly comes in forms.
But there is a problem.
If i retrieve data from Sql Server through a single SELECT statement in forms, it comes perfectly.
But when i retrieve data in forms through CURSOR, the last character of any kind of value in any field truncated.
e. g.
Field Data in Sql Server Data in Forms through CURSOR
CodeNo 00019 0001
Sampleno 01208 0120
Further i have set length of the field at forms more then the length in Sql Server Table.
What is the reason of truncation of data ?
Waiting for reply.
Thanking again in advance.
|
|
|
|
|
|
| Re: ODBC connection in Forms 4.5 [message #358932 is a reply to message #358923] |
Thu, 13 November 2008 00:48   |
kelp
Messages: 10 Registered: October 2008
|
Junior Member |
|
|
Dear Sir,
I have already take that caution when creating the view. i. e. I have already wider all the field 2 times then original in the table.
I am again mentioning that,
If i retrieve data from Sql Server through a single SELECT statement in forms, it comes perfectly.
But when i retrieve data in forms through CURSOR, the last character of any kind of value in any field truncated.
I have check by adding some extra Character at the end of data value in every field when creating a View in Sql Server, but the result is the same.
Waiting for quick reply.
Thanking you.
|
|
|
|
|
|
|
|
| Re: ODBC connection in Forms 4.5 [message #358958 is a reply to message #358940] |
Thu, 13 November 2008 01:14   |
kelp
Messages: 10 Registered: October 2008
|
Junior Member |
|
|
Dear Sir,
Cursor Code as bellow :
cursor mdata is SELECT EntryNo entrno, shiftdate shfdate, Shift shf,
DocNo Dno, RouteCode Rtcode, DBC milk_type, SocietyCode soccode, CowBuff CB, SampleNo smpno,
TotalCan totcan, Noofcan can, Weight wg, fat Gfat,
clr Gclr, snf Gsnf, WeightAuto wgA, FatAuto fatA,
CLRAuto clrA, NoOfCanSour noofcanS, WeightSour wgS,
FatSour fatS, SNFSour snfS, NoOfCanCurd noofcanC,
WeightCurd wgC, FatCurd fatC, SNFCurd snfC,
NoOfCanDestroy noofcanD, WeightDestroy wgD,
DestroyReason destroyR, CanNoSour cannoS, CanNoCurd cannoC,
CanNoDestroy cannoD, IpAddr ip, HostName hostN,
UserId uid, EntryDate entrdate, EditUserId edituid,
EditDate editD, SlipPrinted slipP
FROM Milk_Collection
WHERE CowBuff IN ('C', 'B') and
shiftdate = '2008/10/01' and
dbc = 'SOUR';
Waiting for reply.
Thanks for quick Reply.
|
|
|
|
|
|
|
|
| Re: ODBC connection in Forms 4.5 [message #359211 is a reply to message #359132] |
Fri, 14 November 2008 02:58   |
kelp
Messages: 10 Registered: October 2008
|
Junior Member |
|
|
Dear Sir,
Milk_collection is a view.
If i retrieve data directly from table, it does not display data correctly in forms.
So, as par your hint i am using View based on table.
shiftdate = '2008/10/01' means 'YYYY/MM/dd'.
Further i want to inform you that i have tried by convert the data type of varchar to char in sql server while creating View. And make bigger the size of field. And then added the '-' character at the end of the field value. The data shows like bellow in Sql Server.
Field "DBC" and value "SOUR -"
In the original Table the data in shift field like bellow.
Field "DBC" and value "SOUR"
Then also the problem is same. i. e. Data comes in forms through CURSOR as bellow.
Field "DBC" and value "SOU"
Waiting for reply.
Thanks.
|
|
|
|
| Re: ODBC connection in Forms 4.5 [message #359483 is a reply to message #359211] |
Sun, 16 November 2008 21:00  |
 |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
I stand by my comment "I think that there is a 2-byte length at the beginning of each field. Use something like substr(field,3) to get the data."
Please try my suggestion.
David
|
|
|
|