473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Updating SQL 2000 server using VB6

1
Hi,

I developed an application using VB6 and Access. I now want to move from Access to SQL2000 server. My problem is this, I am connecting to the Database using system DSN and I am getting a system timeout when I try to update a table using code.

example of code is:

Qry = "UPDATE Contract INNER JOIN ContractBenefit ON Contract.ContractId = ContractBenefit.Contractid "
Qry = Qry & "SET ContractBenefit.Startdate = '" & GetDateStr(rspol!DateOfentry) & "', "
Qry = Qry & " ContractBenefit.Enddate = '" & GetDateStr(DateSerial(Year(rspol!DateOfentry), Month(rspol!DateOfentry) + 12, 1 - 1)) & "', "
Qry = Qry & " ContractBenefit.LastUpdateProg = '" & "Nyasys - Issue" & "', ContractBenefit.LastUpdateTime = Now(), "
Qry = Qry & " ContractBenefit.LastUpdateUser = '" & sUserName & "'"
Qry = Qry & " WHERE (((Contract.ContractNumber)='" & txtContract & "'));"
cnCon.Execute Qry

I have to build the query, passing values, then execute. the variable QRY contains the sql statement.

Please help

Desdj
Mar 2 '07 #1
1 2170
dorinbogdan
839 Expert 512MB
Update the connection string to use OLEDB or SQL Server, instead of DSN.
Expand|Select|Wrap|Line Numbers
  1. Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
  2. or 
  3. Provider=sqloledb;Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Mar 2 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: Michael Walton | last post by:
I am trying to write some code that inserts or updates a text field in my SQL Server 2000 database. The SQL statement is created using a submit from a form, and the text is coming from a...
6
by: Hennie de Nooijer | last post by:
Hi, Currently we're a building a metadatadriven datawarehouse in SQL Server 2000. We're investigating the possibility of the updating tables with enormeous number of updates and insert and the...
1
by: Chris Johnson | last post by:
Here is my dilema. I have a 120 GB database that I need to mask customer credit card numbers in. The field is a varchar (16). I need to update the field so that we only store the first 4 numbers...
3
by: Tc | last post by:
Hi, I was curious, I am thinking of writing an application that loads a dataset from a database that resides on a server. The question I have is this, if multiple copies of the app will be...
10
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
14
by: el_sid | last post by:
Our developers have experienced a problem with updating Web References in Visual Studio.NET 2003. Normally, when a web service class (.asmx) is created, updating the Web Reference will...
3
by: Roger Withnell | last post by:
I have a framed website. I plan to include in default.asp a routine to check if the annual subscription is due from the records in the People table. If so, then the routine would send emails...
3
by: John Morgan | last post by:
I have my first small SQl Server 2005 database developed on my local server and I have also its equivalent as an online database. I wish to update the local database (using and asp.net interface)...
2
by: toddw607 | last post by:
Hi Everyone! I have a ASP.NET webform that brings data in from SQL Server 2000 and displays it on a page. I want to update the webpage while in IE using the following code: <%@ Import...
2
by: =?Utf-8?B?TUNN?= | last post by:
I have an asp.net page that contains an update panel. Within the update panel, controls get added dynamically. During partial page post backs the controls within the panel will change. I have a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.