作者alair99 (制造不在场证明)
看板Visual_Basic
标题[.NET] 关於SQL语言
时间Wed Jun 14 00:44:32 2006
请问一下各位大大
我这个程式是要连Foxpro的database, 名称是dictionary
里面有两个栏位 分别是Eword以及Cword
我看了同学的code 他的作法是:
dim vin(2) as object
dim inputstr as string = trim(input.text)
dim blank_pos as integer = instr(inputstr," ")
vin(0) = Mid(inputstr,1 , blank_pos+1)
(主要是让使用者输入一个动词配一个名词 然後我取出动词来实作)
dim string1 as string
string1 = "select Cword from dictionary where Eword in('" vin(0) "')"
为什麽一定要这样才能抓到我想要抓的字呢?
而没办法使用我的作法:
dim vin as string
dim inputstr as string = trim(input.text)
dim blank_pos as integer = instr(inputstr," ")
vin = Mid(inpustr,1 ,blank_pos+1)
dim string1 as string
string1 = "select Cword from dictionary where Eword = vin"
我的这个写法他会显示找不到资料列 'vin'
这是为什麽呢?
不好意思阿 初学者 问题超多 还请见谅
小弟在这里先谢谢大家
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.114.212.94