INSERT INTO baza values("%1", "%2","%3","%4","%5","%6","%7","%8","%9","%10","%11","%12","%13","%14","%15","%16","%17","%18")
где %* это данные с Эдитов на форме добавления записи в БД. MS SQL 2008
Неужели надо перед запросам делать коннект к БД?
Вроде коннект делается при запуске:
Add(OLEdb,7011127,196,84)
{
Point(onError)
link(onConnect,15010175:doCreate,[(238,90)(238,125)(184,125)(184,139)])
link(Driver,2009463:Text,[])
link(onError,6783685:doWork2,[])
}
Add(Button,2401723,147,84)
{
Left=395
Top=70
Width=165
link(onClick,7011127:doOpen,[])
}
Add(Edit,2009463,196,35)
{
Left=5
Top=15
Width=790
Text="DRIVER={LocalServer};SERVER=127.0.0.1;UID=sa;PWD=123;DATABASE=test;"
}
Add(Message,6753516,259,91)
{
}
Add(OLEdb_Query,13534015,196,182)
{
link(onQuery,16321824:doStr,[])
link(onColumns,5673081:doEnum,[(236,195)(236,230)])
link(dbSession,15010175:dbSession,[])
link(Text,10579844:Text,[(209,176)(262,176)])
}
Add(OLEdb_Session,15010175,196,133)
{
Point(onError)
link(onCreate,13534015:doQuery,[(238,139)(238,171)(188,171)(188,188)])
link(dbHandle,7011127:dbHandle,[])
link(onError,6783685:doWork3,[(249,146)])
}
Add(HubEx,6783685,245,91)
{
link(onEvent,6753516:doMessage,[])
}
Add(StringTable,6078793,308,189)
{
Left=10
Top=70
Width=375
Height=225
Point(doAddColumn)
}
Add(MT_Enum,5673081,245,224)
{
link(onItem,6078793:doAddColumn,[])
}
Add(MT_String,16321824,245,182)
{
link(onResult,6078793:doAdd,[(293,188)(293,195)])
}
Add(Edit,10579844,256,137)
{
Left=5
Top=40
Width=790
Text="SELECT * FROM myTable"
}
Форма добавления:
Add(Edit,11531335,364,112)
{
Left=115
Top=10
Width=150
TabOrder=3
Text=""
}
Add(Edit,8053908,371,154)
{
Left=115
Top=30
Width=150
TabOrder=4
Text=""
}
Add(Edit,4909914,378,196)
{
Left=115
Top=50
Width=150
TabOrder=5
Text=""
}
Add(Label,13419684,301,119)
{
Left=30
Top=10
Width=70
Height=17
Font=[MS Sans Serif,8,0,16711680,1]
Caption="Страна"
AutoSize=1
Alignment=1
}
Add(Label,4059475,301,161)
{
Left=30
Top=30
Width=70
Height=17
Font=[MS Sans Serif,8,0,16711680,1]
Caption="Количество"
AutoSize=1
Alignment=1
}
Add(Label,14336432,301,203)
{
Left=30
Top=50
Width=70
Height=17
Font=[MS Sans Serif,8,0,16711680,1]
Caption="Цена"
AutoSize=1
Alignment=1
}
Add(Button,13272033,217,259)
{
Left=120
Top=665
Caption="OK"
Data=Integer(1)
link(onClick,6989287:doEvent1,[])
}
Add(FormatStr,12878242,343,259)
{
DataCount=10
Mask="INSERT INTO testbaza values("%1", "%2","%3","%4","%5","%6","%7","%8","%9","%10","%11","%12","%13","%14","%15","%16","%17","%18")"
Point(FString)
link(onFString,14678189:doEvent,[])
link(Str4,11531335:Text,[])
link(Str5,8053908:Text,[])
link(Str6,4909914:Text,[])
}
Add(Hub,6989287,287,259)
{
link(onEvent1,12878242:doString,[])
}
Add(OLEdb_Query,13534015,560,259)
{
link(dbSession,6036805:Var,[])
link(Text,12878242:FString,[(573,247)(461,247)(461,303)(349,303)])
}
Add(GlobalVar,6036805,560,224)
{
Name="session"
}
Add(Debug,14678189,525,259)
{
link(onEvent,13534015:doQuery,[])
}