Winsock programming, Transmission Control Protocol (TCP)

Başlatan fsan, 25 Kasım 2003, 21:16:06

fsan


[u:7

c8c67a2c4]Winsock programming[/u]
, Transmission Control Protocol/Internet Protocol (TCP/IP).

arkadaslar yukaridaki linkte Visual Basic programin server kisminda

söyle birsey yaziyor:
-------------------------------------------------------------------------------
Creating the Server

The server

portion of the price lookup example is designed to accept the item number sent from the client and look up the associated price in a database. The server than sends the information back to the client.

There is file named as “path.txt” in the folder called as “server”. Locate that file and change the database path in the file to the location where the database is located on

your machine. The connection to the database is made in the DataArrival event of the Winsock control. The following code segment opens the database and finds the first occurrence of the value in

sItemData. When the record is found, the value contained in the price field is sent back to the client.

' Get clients request from database
strData = "Item = '" & sItemData

& "'"
rs.Open "select * from prices", strConnect, adOpenKeyset, adLockOptimistic
rs.Find strData
strOutData =

rs.Fields("Price")

-------------------------------------------------------------------------------------

bu arkadasin anlatmaya calistigi "database" olayi nedir nasil yapariz

?? birde "path.txt" in icinde  bu dadabase dosyasinin oldugu yeri göster yaziyor, bu nasil yazilacak neden böyle bir seye ihtiyac var?

programi compile/run yaparken

"Dim fso As New FileSystemObject,...." üzerinde durup bu mesaji veriyor: "Compile error!,  user defined type not

defined"
?? burada forma bir object felan mi eklenecekti ?

VB dosyalari buraya

koydum
http://home.no/fsan/projects/Diverse/Winsock%20programming/

tesekkürler...

DumrulBey

Alıntı YapThe database used in the sample is also provided with the code. The database name is

Prices.mdb. This is a small database comprising of a single table containing two fields. The fields are item number and price. The clients

sends the item number to the server and the server retrieves the price against that item number from the database and sends it back to the client.

Kardeş yukarıdaki

alıntıyı siteden aldım. Koyu reknli yerlerde vurguladığım gibi "Prices.mdb" isminde bir veritabanı ve içinde "price" isminde sütün oluşturdun mu?
Alıntı YapThere is file named

as “path.txt” in the folder called as “server”. Locate that file and change the database path in the file to the location where the database is located on your machine.

The connection to the database is made in the DataArrival event of the Winsock control.
Anladığım kadarıyla program FSO ile Winsock

denetiminde veritabanına erişiyor. Dolayısıyla "path.txt" içinde veritabanında tanıtmak gerekiyor. Eğer veritabanı bir web server üzerinde değilse yani lokal çalıştırıyorsan denetim masasından

tanımlamalısın.

Kolay gelsin...
Bilgi paylaştıkça bir bakmışız; kar topu olmuş ve çığ gibi üzerimize geliyor...:)

uet

"Compile error!, user defined type not defined"   bu demek oluyor ki tanımlı tip yok veya bulunamadı. sizin kullandığınız

FileSystemObject şu an projenizde aktif olarak bulunmuyor. reference'lerden akleyin.

sizde demişsiniz zaten object falanmı eklenecek. tam üstüne basmışsınız.
ilgili nesneyi

referanslardan ekleyin.
kolay gelsin