Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6150605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:38:16+00:00 2026-05-23T19:38:16+00:00

Honest, I am really trying to learn this stuff. I’ve been using Classic ASP

  • 0

Honest, I am really trying to learn this stuff. I’ve been using Classic ASP for years and just switching over to .net. So far, I’m not having much fun, but I’m trying and I’m not going to quit. One of the small pieces I am struggling with is running a query then, updating the record. Even googling for examples, I having a tough time figuring out how to do something simple like:

    Set objRS = Server.CreateObject ("ADODB.RecordSet")

ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
          "Data Source=G:\Inetpub\wwwroot\TestPage\TheData\TestData.mdb;" & _
          "Persist Security Info=False"

SqlStr = "SELECT * " & _
         "FROM Techs " & _
         "WHERE UserID = " & UserID & " "

objrs.Open SqlStr, ConStr, adOpenStatic, adLockOptimistic,adCmdText
If Objrs.recordCount <> 0 Then
   TechUserName = Objrs("TechUserName")
   Objrs.Update
      Objrs("LastLogin") = Now()
   Objrs.Update
Else
   Objrs.AddNew
      Objrs("UserID") = UserID
   Objrs.Update
End If
Objrs.Close

Set objRS = Nothing

Is it even possible? Can someone please help me do the above code in ASP.net (VB) or point me to a really good thorough tutorial on how to do this.
Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T19:38:17+00:00Added an answer on May 23, 2026 at 7:38 pm

    Woo Hoo I got it!

    Dim SqlStr As String
    Dim ConStr As String = ConfigurationManager.ConnectionStrings("TCConStr").ConnectionString
    
    SqlStr = "SELECT * " & _
             "FROM TechUsers " & _
             "WHERE TechWWID = " & Chr(34) & TechWWID & Chr(34) & " " & _
             "AND TechEmplNum = " & TechEmplNum & " "
    
    Dim CN As OleDbConnection = New OleDbConnection(ConStr)
    CN.Open()
    Dim DA As OleDbDataAdapter = New OleDbDataAdapter(SqlStr, CN)
    Dim DS As New DataSet
    DA.Fill(DS, "TechUsers")
    Dim DT As DataTable = DS.Tables("TechUsers")
    Dim RecCount As Integer = DT.Rows.Count
    Dim CB As OleDbCommandBuilder = New OleDbCommandBuilder(DA)
    
    If RecCount = 0 Then
        DA.InsertCommand = CB.GetInsertCommand()
        Dim DR As DataRow = DT.NewRow()
        DR("TechName") = TechName
        DR("TechWWID") = TechWWID
        DR("TechEmplNum") = TechEmplNum
        DR("FirstLogin") = Date.Now()
        DR("LastLogin") = Date.Now()
        DR("LoginCount") = 1
        DT.Rows.Add(DR)
        DA.Update(DS, "TechUsers")
    Else
        Dim DR As DataRow = DT.Rows(0)
        Dim LoginCount As Integer = DR("LoginCount")
        TestStuff.InnerHtml = TestStuff.InnerHtml & "<br > " & LoginCount
        DA.UpdateCommand = CB.GetUpdateCommand()
        DR("LastLogin") = Date.Now()
        DR("LoginCount") = LoginCount + 1
        DA.Update(DS, "TechUsers")
    End If
    
    CN.Close()
    

    Thanks everyone for the clues to get this done.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(This looks like a long question, but it's not really, honest!) I am trying
Well, to be honest it works just for one client, don't really know why.
I have been using ruby exclusively for about a month and I really love
I just read this post about why new-line warnings exist, but to be honest
So I have an app that if I'm honest doesn't really need transactional integrity
to be honest, I don't really know what the small green men in my
I'm going to be honest: this is a question I asked on the Django-Users
There's always skepticism from non-programmers when honest developers learn the techniques of black hat
Just looking for the first step basic solution here that keeps the honest people
I don't really know how to ask this, so I wrote up the script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.