delphi和sqlserver交互
chance
posted @ 2012年12月01日 11:43
in delphi
, 1393 阅读
{利用adoquery调用sql server存储过程} procedure TForm1.Label1Click(Sender: TObject); begin adoquery1.Close; adoquery1.SQL.Clear ; adoquery1.SQL.Add('exec proc_stu :a output,:b,:c'); adoquery1.Parameters[1].Value :=strtoint(edit1.Text); adoquery1.Parameters[2].Value :=strtoint(edit2.Text); adoquery1.Parameters[0].DataType:=ftsmallint; adoquery1.Parameters[0].Direction:=pdoutput; adoquery1.Prepared:=true; adoquery1.Open ; edit3.Text:= inttostr(adoquery1.Parameters[0].Value ); end; {利用adostoreproc调用sql server标量函数} procedure TForm1.Label2Click(Sender: TObject); begin adostoredproc1.ProcedureName :='rectanglearea'; adostoredproc1.close; adostoredproc1.Parameters.Refresh;//Clear会导致数组溢出异常。 adostoredproc1.Parameters.CreateParameter('return_value',ftfloat,pdreturnvalue,20,null);//函数返回值 adostoredproc1.Parameters.CreateParameter('a',ftfloat,pdinput,10,null); adostoredproc1.Parameters.CreateParameter('b',ftfloat,pdinput,10,null); adostoredproc1.Parameters[1].Value :=strtofloat(edit1.Text); adostoredproc1.Parameters[2].Value :=strtofloat(edit2.Text); adostoredproc1.Prepared :=true; adostoredproc1.ExecProc ; edit3.Text:= floattostr(adostoredproc1.Parameters[0].Value ); end; {利用adostoreproc调用sql server存储过程} procedure TForm1.Button1Click(Sender: TObject); begin adostoredproc1.ProcedureName :='proc_stu'; adostoredproc1.close; adostoredproc1.Parameters.Clear ; //adostoredproc1.Parameters.CreateParameter('return_value',ftfloat,pdreturnvalue,20,null); adostoredproc1.Parameters.CreateParameter('a',ftinteger,pdoutput,10,null);//参数名不需要与sql中定义的参数名相同 adostoredproc1.Parameters.CreateParameter('b',ftinteger,pdinput,10,null); adostoredproc1.Parameters.CreateParameter('c',ftinteger,pdinput,10,null); adostoredproc1.Parameters[1].Value :=strtofloat(edit1.Text); adostoredproc1.Parameters[2].Value :=strtofloat(edit2.Text); adostoredproc1.Prepared :=true; adostoredproc1.Open ;//有与dbgrid相关联,应用open而不是execproc. edit3.Text:= floattostr(adostoredproc1.Parameters[0].Value ); end; {利用adoquery调用sql server表值函数} procedure TForm1.Button2Click(Sender: TObject); begin adoquery1.Close; adoquery1.SQL.Clear ; adoquery1.SQL.Add('select * from dbo.tt(:a)'); adoquery1.Parameters[0].Value :=edit1.Text ; adoquery1.Prepared:=true; adoquery1.Open ; //edit3.Text:= inttostr(adoquery1.Parameters[0].Value ); end;
2024年1月16日 15:19
Heya i am for the primary time here. I found this board and I in finding It truly useful & it helped me out a lot. I’m hoping to offer something again and help others such as you aided me.
2024年2月22日 13:58
Great work! That is the kind of info that should be shared across the internet. Shame on Google for now not positioning this submit upper! Come on over and visit my web site . Thanks =)
2024年2月22日 15:06
Great work! That is the kind of info that should be shared across the internet. Shame on Google for now not positioning this submit upper! Come on over and visit my web site . Thanks =)
2024年2月22日 15:07
You could definitely see your skills within the paintings you write. The arena hopes for more passionate writers like you who are not afraid to say how they believe. Always follow your heart.
2024年2月22日 15:07
I?ve recently started a website, the information you offer on this website has helped me tremendously. Thanks for all of your time & work.
2024年2月22日 15:20
My spouse and I absolutely love your blog and find a lot of your post’s to be exactly what I’m looking for. Do you offer guest writers to write content in your case? I wouldn’t mind writing a post or elaborating on a few of the subjects you write with regards to here. Again, awesome web site!
2024年2月22日 15:45
Thank you for every other magnificent article. Where else may just anyone get that kind of info in such an ideal manner of writing? I have a presentation subsequent week, and I am at the search for such info.
2024年2月22日 15:45
It is really a nice and helpful piece of info. I?m glad that you shared this useful information with us. Please keep us informed like this. Thanks for sharing.
2024年2月22日 15:46
We’re a group of volunteers and starting a new scheme in our community. Your website provided us with valuable information to work on. You’ve done a formidable job and our entire community will be grateful to you.
2024年2月22日 15:47
Oh my goodness! an amazing article dude. Thank you Nevertheless I am experiencing situation with ur rss . Don?t know why Unable to subscribe to it. Is there anyone getting identical rss downside? Anybody who is aware of kindly respond. Thnkx
2024年2月22日 15:48
My partner and I absolutely love your blog and find many of your post’s to be what precisely I’m looking for. Would you offer guest writers to write content to suit your needs? I wouldn’t mind composing a post or elaborating on a number of the subjects you write in relation to here. Again, awesome site!
2024年2月22日 15:49
My partner and I absolutely love your blog and find many of your post’s to be what precisely I’m looking for. Would you offer guest writers to write content to suit your needs? I wouldn’t mind composing a post or elaborating on a number of the subjects you write in relation to here. Again, awesome site!
2024年2月22日 15:50
Thanks, I have all the files, is there any way that the geometry and mesh can be connected again? Now, I can import to a new .wbpj each file independently, so if I need to remesh my model, I need to change the geometry and start meshing from scratch.
2024年2月22日 15:50
Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better. The post is written in very a good manner and it contains many useful information for me. Thank you very much and will look for more postings from you.
2024年2月22日 15:51
This is really likewise an incredibly beneficial placing most of us severely encountered shopping as a result of. It truly is faraway from each and every day we have now possibility to think about something.
2024年2月22日 15:51
This is really likewise an incredibly beneficial placing most of us severely encountered shopping as a result of. It truly is faraway from each and every day we have now possibility to think about something.
2024年2月22日 15:53
Hi, i feel that i noticed you visited my website so i got here to ?go back the prefer?.I’m trying to to find things to enhance my website!I guess its ok to use some of your ideas!!
2024年2月22日 15:53
Oh my goodness! an amazing article dude. Thank you Nevertheless I am experiencing situation with ur rss . Don?t know why Unable to subscribe to it. Is there anyone getting identical rss downside? Anybody who is aware of kindly respond. Thnkx
2024年2月22日 15:54
Hi, i feel that i noticed you visited my website so i got here to ?go back the prefer?.I’m trying to to find things to enhance my website!I guess its ok to use some of your ideas!!
2024年2月22日 15:56
I think one of your commercials triggered my web browser to resize, you may well want to put that on your blacklist.
2024年2月22日 16:49
Even nevertheless there are lots of decision methods with the purpose of lookup used for non published numbers, but you would approximating rapid stately results to you possibly will look forward to in, you possibly will necessitate with the purpose of desire particular sort of swap telephone search company.
2024年2月22日 16:54
Woah I’m just genuinely digging the style/thought of this web site. It’s straightforward, however fantastic. Additional frequently than not it is demanding to acquire the perfect involving exceptional usability along with visual physical appearance. I should say you have carried out a brilliant task. In addition, your web page starts tremendous rapidly personally with Web explorer. Outstanding Internet site
2024年2月22日 16:55
Thanks, I have all the files, is there any way that the geometry and mesh can be connected again? Now, I can import to a new .wbpj each file independently, so if I need to remesh my model, I need to change the geometry and start meshing from scratch.
2024年2月22日 16:58
Goodness! Such an astounding and supportive post this is. I outrageously cherish it. It's so great thus amazing. I am simply flabbergasted. I trust that you keep on doing your work like this later on moreover.
2024年2月22日 16:58
I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
2024年2月22日 20:16
It a fabulous blog post As i looked at caused by have the application. Advise everything that Need be to find expectation on potential future you certainly will persist designed for writing a great wonderful blog post.
2024年2月22日 20:17
I was suggested this web site through my cousin. I’m not certain whether this put up is written through him as no one else recognize such exact approximately my difficulty. You’re wonderful! Thank you!
2024年2月22日 20:18
“I have to say, your blog is a breath of fresh air. There are so many generic and uninspired blogs out there, but yours really stands out for its originality and creativity.”
2024年2月22日 20:20
“I have to say, your blog is a breath of fresh air. There are so many generic and uninspired blogs out there, but yours really stands out for its originality and creativity.”
2024年2月22日 20:20
If more people that write articles really concerned themselves with writing great content like you, more readers would be interested in their writings. Thank you for caring about your content.
2024年2月22日 20:21
My partner and I absolutely love your blog and find many of your post’s to be what precisely I’m looking for. Would you offer guest writers to write content to suit your needs? I wouldn’t mind composing a post or elaborating on a number of the subjects you write in relation to here. Again, awesome site!
2024年2月22日 20:21
Two full thumbs up for this magneficent article of yours. I've truly delighted in perusing this article today and I figure this may be outstanding amongst other article that I've perused yet. If it's not too much trouble keep this work going ahead in a similar quality.
2024年2月22日 20:22
I truly contented to come all over your special data. I like this web page.
2024年2月22日 20:25
Your online diaries propel more each else volume is so captivating further serviceable It chooses me happen for pull back repeat. I will in a blaze grab your reinforce to stay instructed of any updates.
2024年2月22日 20:26
I appreciated how flexible the team at amcauto.co was when it came to scheduling appointments and test drives. They were always willing to work around my schedule.
2024年2月22日 20:27
We’re a group of volunteers and starting a new scheme in our community. Your website provided us with valuable information to work on. You’ve done a formidable job and our entire community will be grateful to you.
2024年2月22日 20:56
I wish more authors of this type of content would take the time you did to research and write so well. I am very impressed with your vision and insight. <a href="http://truediamond.co.uk/">seo service UK</a>
2024年2月22日 20:57
I wish more authors of this type of content would take the time you did to research and write so well. I am very impressed with your vision and insight.