Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert hex to string

Status
Not open for further replies.

HomerJS

Programmer
Jun 25, 2001
86
0
0
US
I have a value that I need to convert to a hex number, take off the leading Fs, and then use the rest to retrieve a file.

Example:
value: -2144747826

hex value: FFFFFFFF8029BECE

file name: 8029BECE

The way I have it set up so far is I have the hex value in a SQL database with the varbinary datatype. However I can't convert that to a string value so I can use it as a file name.

Any suggestions would be appreciated.

Thanks!
 
Here you go:

Dim intInput As Long = -2144747826
Dim strHex As String = Hex(intInput)
MsgBox(strHex.TrimStart("F"))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top