INSERT SQL Statment
INSERT SQL Statment
INSERT SQL Statment
INSERT SQL Statment
INSERT SQL Statment
INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment
INSERT SQL Statment INSERT SQL Statment
INSERT SQL Statment
Go Back  Xtreme Visual Basic Talk > > > INSERT SQL Statment


Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2003, 04:36 PM
gpwake gpwake is offline
Newcomer
 
Join Date: Nov 2003
Posts: 14
Default INSERT SQL Statment


This is working for me, but it is really slow! Anyone out there have a better solution for INSERTING records into a database???

DIM strSQLsc as String

'SQL Statement
strSQLsc = "INSERT INTO tblShowTimes (HOUSE_ID,MOVIE_ID,WITH_ID,PLAYDATE,TIMES,ALLOWPASS,SOUND,
COMMENTS,SCREEN,FESTIVAL) VALUES" & LineOfTextSC

'Insert Record
Dim objCmdInsert As New Data.OleDb.OleDbCommand(strSQLsc, objConnection)

Dim objAdapterSC As New Data.OleDb.OleDbDataAdapter(objCmdInsert)
Dim objTableSC As New Data.DataTable()
objAdapterSC.Fill(objTableSC)

It works, just not very good...LOL
Reply With Quote
  #2  
Old 12-23-2003, 06:37 PM
Optikal's Avatar
OptikalINSERT SQL Statment Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

get rid of the last 3 lines, and just do objCmdInsert.ExecuteNonScaler()
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #3  
Old 12-23-2003, 07:42 PM
gpwake gpwake is offline
Newcomer
 
Join Date: Nov 2003
Posts: 14
Default

Quote:
Originally Posted by Optikal
get rid of the last 3 lines, and just do objCmdInsert.ExecuteNonScaler()



Thanks! I knew I had way too many steps in there.
Reply With Quote
  #4  
Old 12-29-2003, 05:33 PM
gpwake gpwake is offline
Newcomer
 
Join Date: Nov 2003
Posts: 14
Default

Quote:
Originally Posted by gpwake
Quote:
Originally Posted by Optikal
get rid of the last 3 lines, and just do objCmdInsert.ExecuteNonScaler()



Thanks! I knew I had way too many steps in there.



Just a quick update... I took Optikal's advice and it worked great!
I did however change the objCmdInsert.ExecuteNonScalar() method
to the following:

objCmdInsert.ExecuteNonQuery() as I was not requiring that any rows or records be returned.

Again...Thanks for pointing me in the right direction Optikal, much appreciated!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL error in Vb Code blong824 Database and Reporting 16 03-14-2004 06:07 PM
Using SQL INSERT to place new data in an ACCESS DATABASE deathcrush Database and Reporting 0 06-17-2003 12:24 PM
Problem with writing Twice Renidrag Web Programming 20 11-07-2002 03:52 PM
Creating Access Databases TomGuy Database and Reporting 8 07-10-2002 11:56 AM
SQL Insert Into Doesn't Insert Any Data koltz Database and Reporting 2 06-01-2002 06:59 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
INSERT SQL Statment
INSERT SQL Statment
INSERT SQL Statment INSERT SQL Statment
INSERT SQL Statment
INSERT SQL Statment
INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment INSERT SQL Statment
INSERT SQL Statment
INSERT SQL Statment
 
INSERT SQL Statment
INSERT SQL Statment
 
-->