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

  • Home
  • SEARCH
  • 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 53207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:01:38+00:00 2026-05-10T17:01:38+00:00

Function FillAdminAccount() As Boolean FillAdminAccount = True Try SQLconn.ConnectionString = connect timeout=9999999; & _

  • 0
Function FillAdminAccount() As Boolean      FillAdminAccount = True             Try          SQLconn.ConnectionString = 'connect timeout=9999999;' & _                                    'data source=' & DefaultIserver & ';' & _                                    'initial catalog=' & DefaultIdBase & '; ' & _                                    'user id=userid;' & _                                    'password=userpass;' & _                                    'persist security info=True; ' & _                                    'packet size=4096'         SQLconn.Open()          SQLcmd.CommandType = CommandType.Text          SQLcmd.CommandText = 'Select distinct username, cast(convert(varchar,userpassword) as varchar) as 'userpassword' from ' & tblUsersList & ' where usertype='MainAdmin''         SQLcmd.Connection = SQLconn          SQLreader = SQLcmd.ExecuteReader          While SQLreader.Read = True             CurrentAdminUser = SQLreader('username').ToString             CurrentAdminPass = SQLreader('userpassword').ToString   'PROBLEM'         End While      Catch ex As Exception         ErrorMessage(ex)     Finally         If SQLconn.State = ConnectionState.Open Then SQLconn.Close()         If SQLreader.IsClosed = False Then SQLreader.Close()     End Try  End Function    'FillAdminAccount 

Please see the line with the comment PROBLEM. On this code, the output is equal to ‘userpassword. As you can see, there is no quotation mark on the right and I wonder why. By the way, the data type of the userpassword in the database is BINARY. Wish you could help me on this. Thank you..x_x

  • 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. 2026-05-10T17:01:39+00:00Added an answer on May 10, 2026 at 5:01 pm

    NEVER store actual passwords in the db. Now it looks like your passwords might not quite be plain text because of the convert/cast operations, but you still have a problem. At very least any encryption used is easily reversible, and if your sql server ever ends up on a different machine from the application then passwords will be traveling over the wire in plain text.

    If you MUST do this (perhaps because of a legacy system or mandate from above) then at least do the matching at the server so that the password never comes back to the application.

    What you should be doing is using something like SQL Server 2005’s HashBytes() function to only store a hash of the actual password. When someone tries to login, hash their attempted password and match up the hashes.

    As to your specific question, my guess is the cast or convert operation failed resulting in a NULL value coming back to the application. And do you have both a CAST() and a CONVERT() to the same type? It’s redundant.

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

Sidebar

Ask A Question

Stats

  • Questions 84k
  • Answers 84k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer All styles you apply using javascript and DOM calls, apply… May 11, 2026 at 4:57 pm
  • Editorial Team
    Editorial Team added an answer Yes, you can use serialize to trivially convert the form… May 11, 2026 at 4:57 pm
  • Editorial Team
    Editorial Team added an answer one way is to do something like print_all_solutions :- solution(Sol),… May 11, 2026 at 4:57 pm

Related Questions

function returnsAnArray () { return array ('test'); } echo returnsAnArray ()[0]; generates a syntax
function Submit_click() { if (!bValidateFields()) return; } function bValidateFields() { /// <summary>Validation rules</summary> ///
function main() { Hello(); } function Hello() { // How do you find out
function AddTheatres() { Services.AdminWebServices.AddTheatresSVC(oTheatres, OnSuccessTheatres, OnError, OnTimeOut); } function OnSuccessTheatres(result1) { Services.AdminWebServices.AddTicketPricesSVC(oTicketPrices, OnSuccessTicketPrices, OnError,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.